← begumkoca.comGitHub ↗

Writing · October 2026

ConductLens: a CFPB complaints pipeline that runs for free and survives its own warehouse

18.7 million consumer complaints, every US bank charter's deposits and five interest-rate series, landed incrementally in BigQuery, modelled with dbt, run every day on Airflow, and served as a public dashboard that answers ten questions a challenger bank would actually ask.

PythonBigQuerydbtAirflowCosmosHexDocker

The problem

Every complaint a US consumer escalates to the Consumer Financial Protection Bureau about a bank, a card issuer, a fintech or a debt collector becomes public within days. For a bank that is three things at once: Compliance uses it to spot regulatory exposure, Customer Operations wants to know whether service is getting better or worse relative to peers, and Product wants to know which products and issues are generating friction across the whole industry. In most places each of those teams downloads a CSV by hand once a quarter.

I set myself the brief of replacing that CSV with a pipeline that runs unattended, recovers from failures without manual cleanup, and stays inside free allowances: the BigQuery sandbox with no billing account, a local Docker Airflow, and a Hex workspace. The dashboard had to answer ten questions, from “how many complaints this week versus the same week last year” to “do mortgage complaints move with interest rates, and with what lag”.

Stacked area chart of monthly CFPB complaints by product group over the last 36 months
Monthly complaints by product group. Credit reporting is the whole story of the last three years: the three bureaus account for 14.7 of the 18.7 million complaints.

Architecture

Three sources: the CFPB publishes the entire complaint database as one bulk CSV every day (358 MB zipped, 5.6 GB raw), the FDIC BankFind API lists every charter with its deposits, and FRED serves daily rate series as CSV. A Python package downloads each, normalises it to parquet, hashes the business columns of every row, and appends to BigQuery only the rows whose key and hash are not already there. dbt then builds staging views, one intermediate grain, and fourteen marts, one per business question. Airflow runs the whole thing at 13:00 UTC with astronomer-cosmos rendering every dbt model and every test as its own task, and a public Hex app reads the marts.

Airflow grid showing each dbt model rendered as a task group with run and test tasks
Cosmos renders each dbt model as a task group with a run and a test task. A red box names the model that broke, and the edges show what did not get built because of it.

The design decision that shapes everything else is that complaint rows mutate. A complaint is published the day it is received; the company response and the timeliness flag fill in over the following weeks. “Incremental by received date” would freeze every complaint in its day-one state. So every run re-pulls a trailing 60-day window, hashes it, and appends only new versions; staging picks the newest version per complaint, and a key that the warehouse has but the file no longer has gets a tombstone. Re-running any window re-derives the same hashes and writes nothing, which is what makes Clear in Airflow always safe and a backfill the same code path with explicit dates.

What the free tier forced

The BigQuery sandbox is genuinely free, and it has three rules that no amount of code can argue with: every table, view and partition is deleted 60 days after it is created and the expiry cannot be removed; there is no DML, so no MERGE; and storage is a lifetime 10 GiB budget that deleting data does not refund. I measured the complaint-level log at 7.7 GB of BigQuery logical bytes. Keeping it alive would mean rewriting it every 60 days: about 46 GB a year against a 10 GiB lifetime.

Two decisions came out of that. First, BigQuery holds the complaint log at the daily-cell grain: one row per date, company, product, sub-product, issue, state, response and timeliness flag, with the strings replaced by integer codes. All ten questions are aggregates over exactly that grain, so nothing the dashboard needs is lost. Those 5.16 million cells sum to exactly 18,653,525 complaints and cost 0.69 GB instead of 7.7, which stretches the lifetime budget to roughly eighteen months. Second, the same ingestion writes a full complaint-level copy to Databricks Free Edition, where tables never expire, the same dbt project builds the same marts there, a daily parity task compares every mart across the two warehouses, and the public app reads the copy that is always there. If a BigQuery table expires, the next run recreates and reloads it; the dashboard does not notice.

BigQuery console showing the complaint cell table partitioned by integer range on received_month_id and clustered by company and product
The BigQuery cell table: integer-range partitioned on received month rather than a DATE, because in the sandbox a date partition would itself expire after 60 days and delete history. Clustered by company and product, which is what every dashboard query groups by.
BigQuery query result: 5,163,903 cells summing to 18,653,525 complaints
5,163,903 cells, 18,653,525 complaints, 2011-12-01 to 2026-10-23.
Databricks SQL editor showing row counts of the three raw tables
The persistent copy: 18.65 million complaint rows at full fidelity, 27,835 FDIC charters, 14,164 rate observations.

The honest parts

Company names in the CFPB data are free text. The CFPB writes “JPMORGAN CHASE & CO.”; the FDIC has several charters under that holding company plus charters whose names say nothing about the parent. Matching is a manual seed first, then a normalised-name join against holding-company names, then against charter names, and every row carries how it was matched. Eighty percent of all complaints are about the three credit bureaus, which are not banks and are not supposed to match, so the overall match rate is deliberately not the headline. The number that is published, and tested, is the matched share of bank-product complaints.

Deposit normalisation only exists for chartered banks. PayPal, Chime, Affirm and Coinbase have no FDIC charter and no deposits of their own, so the benchmark has two peer groups: chartered banks ranked by complaints per billion dollars of deposits inside size buckets, and fintechs ranked by raw volume among themselves. Nobody is silently dropped.

Horizontal bar chart of complaints per billion dollars of deposits among chartered peers, with one bank highlighted
Complaints per $1bn of deposits among chartered peers in the same size bucket, our bank highlighted.

Two more things the data itself decided. The CFPB stopped collecting the “consumer disputed?” flag in April 2017 and the bulk export no longer carries the column, so the dispute-rate question is answered with a coverage share next to every number rather than a stale rate presented as current. And no CFPB sub-product currently contains “buy now, pay later”, so the BNPL product group is wired but empty, and BNPL lenders are tracked through a digital-first segment instead.

Line chart of monthly timely-response share for digital-first fintechs versus chartered banks
Timely-response share, digital-first fintechs versus chartered banks, last 36 months.
Faceted line chart of the correlation between 4-week complaint changes and rate changes lagged 0 to 26 weeks
Do complaints follow rates? Correlation of 4-week complaint changes with rate changes lagged 0 to 26 weeks, mortgage and credit card side by side. The lag arithmetic lives in a dbt mart, not in the chart, so it is tested.
Table showing how much complaint volume sits behind each company matching method
The honesty panel at the bottom of the app: how much volume sits behind each matching method.

What broke on the first real run

The first end-to-end Airflow run produced two failures, and I kept both in the evidence because they are the point of the design. The ingest tasks failed on a command-line argument bug of mine; after the fix I cleared the whole group and it re-ran, writing zero rows, because the version log had already absorbed the first attempt. Then one dbt model failed on BigQuery because groups is a reserved word there and not on Databricks; after a one-line rename, only that model and its three downstream tasks were cleared. Ninety-four other tasks were untouched.

Airflow task detail showing the lag-correlation model queued for its third try after being cleared
One model cleared and re-queued after the fix. The granularity is what one-task-per-model buys you.
Airflow grid view with two complete runs, all 99 tasks green
The first two end-to-end runs: 99 tasks each, both green, 21 minutes.

By the numbers

18,653,525
complaints in the CFPB file, 2011 to today
22 s
to turn the 5.6 GB CSV into a 163 MB parquet
0 rows
written by a re-run when nothing changed
5,163,903
daily cells in BigQuery, 0.69 GB instead of 7.7
23 models · 153 tests
in one dbt project that builds on both warehouses
99 tasks
per Airflow run, one per dbt model and test, 21 minutes
14 / 14
marts identical across the two warehouses in the daily parity check
$0
BigQuery sandbox, Databricks Free Edition, Hex, local Airflow

The repository holds the ingestion package with its tests, the dbt project with generated docs, the Airflow stack as a Docker Compose file, the Hex SQL for all ten questions, and a README that defends each design decision and states the storage footprint and monthly scanned bytes. The dashboard is public.