Skip to content

Diogo TravassosData leadership · Analytics · Decision-making

Public dataSynthetic faults

Data quality scorecard · lineage and SLOs

Self-test, 20 changes, base case: wrong numbers on 48 days (summed) with no lineage, 46 with impact analysis, 17 with SLOs, 0 with a gate run before views.

Each change ran alone on its own copy of the month, and a day counts when a viewer read at least one wrong tile with no warning. Lineage told owners at deploy that an asset may change (0 hours by construction, against 18, a 15:00 deploy to the 09:00 view; 4 of 40 never told against 14) but cut wrong days only on the 2 changes it held back for a renamed column. The service levels caught all 6 breaking source changes before anyone looked, by the schedule's design (checks at 06:00, views at 09:00), and missed 4 value changes no service level measures, which left the 17 days. The gate caught those 4, let 1 change through whose only effect fell outside its 7-day sample, and blocked 2 of the 4 harmless code changes.

Key figures
Wrong days without lineage, summed over the changes48 daysbase case, 34 of them off by 1% or more; 30 to 100 across the 16 cells of the sensitivity grid; 14 of 20 changes left at least oneWith lineage and service levels17 days17 to 43 across the grid; every one from the 4 value changes no service level measured: 14 of them the rounded miles, 0.13% to 0.25% off; 3 off by 1% or moreWith a pre-deploy gate added0 daysin every cell: the grid moves only noticing and fixing, and nothing reached a viewer; the one change it passed touched only January 31, after the last view. It blocked 2 of the 4 harmless code changes, one of them a dropped column that this page's own comparison counts as a broken tableBroken assets the impact list named135 of 152column lineage with row dependencies, which also named 42 that did not break; select expressions alone named 27; model-level named all 152 and 124 more

Main limitation One author wrote the dashboards, the 20 changes, the service levels and the gate, and each change ran alone on one month of 10,000 public trips. How far off a number must be before a viewer notices, the view times and the fix lag are assumptions, and lineage parsed from the code is exact here because one author wrote all of it. The six source changes re-test fault kinds the scorecard already checks; on faults written blind, the same study's checks caught 2 of 8 on the scorecard and 3 of 10 and 4 of 10 in pipeline recovery.

Wrong numbers, by setup

Service levels removed most wrong days; the gate removed the rest, on changes written by the same author.

Days on which a viewer saw at least one wrong tile without a warning, summed over the 20 changes, base case. The line is the range across the sensitivity grid.

Code changesSource changesRange across the grid

Days a viewer saw a wrong number, summed over the 20 changes, by setupNo lineage 48 days in the base case, 30 to 100 across the grid; Impact analysis before deploy 46 days in the base case, 28 to 93 across the grid; Plus service levels 17 days in the base case, 17 to 43 across the grid; Plus a pre-deploy gate 0 days in the base case, 0 to 0 across the grid.0255075100Days with a wrong number, summed over the changesNo lineage: 48 wrong days in the base case (34 from code changes, 14 from source changes), 30 to 100 across the 16 cells of the grid; 14 of 20 changes left at least oneNo lineage48Impact analysis before deploy: 46 wrong days in the base case (32 from code changes, 14 from source changes), 28 to 93 across the 16 cells of the grid; 12 of 20 changes left at least oneImpact analysis before deploy46Plus service levels: 17 wrong days in the base case (17 from code changes, 0 from source changes), 17 to 43 across the 16 cells of the grid; 4 of 20 changes left at least onePlus service levels17Plus a pre-deploy gate: 0 wrong days in the base case (0 from code changes, 0 from source changes), 0 to 0 across the 16 cells of the grid; 0 of 20 changes left at least onePlus a pre-deploy gate0
Show the data
Each setup over the 20 changes, base case
SetupWrong daysAcross the gridOff by 1% or moreUnder a warningChanges with any
No lineage: owners hear when a viewer notices a wrong tile4830 to 10034014
Lineage impact analysis before each deploy4628 to 9332012
Lineage plus service levels (SLOs) on the published tables1717 to 43374
Lineage, SLOs and a pre-deploy gate with rollback00 to 0050

A day counts once per change when at least one tile a viewer read that morning was wrong at the precision it shows and carried no warning. "Under a warning" counts the days a viewer read a tile that a service level had flagged.

Without lineage, 14 of the 48 wrong days were off by less than 1%: the miles rounded to whole numbers moved the month's miles by 0.13% to 0.25%, which no viewer would notice. The quiet changes cost the most days. Dropping the 17 trips with no fare from the intermediate model left the trip counts a fraction of a percent low and the 7-day shared match rate 3.1% to 7.1% off, under the 10% at which a viewer notices, for 14 days; a dropped January 5 left the month's trip count 3.5% to 5.1% short for 8 days. The loud ones (a tile that will not render, yesterday missing, a rate that doubles) were noticed the first time someone read the dashboard that showed them, and fixed in the next build or when the late rows landed.

What each change broke, and what caught it

Each change ran alone on its own copy of the month. Assets are the 4 models, 10 metrics and 10 tiles; one is broken when it differs from the month without the change at any point. The last column is the first catch with every check in place.

The 20 changes: assets broken, wrong days per setup in the base case, and the first catch with the gate in place
ChangeKindAssets brokenNo lineageImpact analysis before deployPlus service levelsPlus a pre-deploy gateFirst caught by
Column renamed in the staging model
stg_trips renames pickup_zone_id to pickup_area_id; daily_trips is not updated; lands 15:00 on January 10
Code71000Lineage, before deploy
Column renamed in the mart
daily_trips renames total_fare to fare_total; the dashboard query is not updated; lands 15:00 on January 12
Code21000Lineage, before deploy
Miles cast to whole numbers
stg_trips casts trip_miles as integer instead of double, so every distance is rounded; lands 15:00 on January 11
Code61414140The gate, before deploy
Zero-distance trips filtered in staging
stg_trips drops trips whose trip_miles is not above zero; lands 15:00 on January 16
Code90000A service level at 06:00 on February 1, rolled back
Missing fares filtered in the intermediate model
trips drops rows whose fare is empty; lands 15:00 on January 17
Code15141400The gate, before deploy
Outside-Chicago trips filtered in the mart
daily_trips drops trips whose pickup area is 0 (outside Chicago or unavailable); lands 15:00 on January 18
Code51100The gate, before deploy
Shared-trip metric reads the wrong flag
the semantic layer's matched-trips measure counts trips authorized to share instead of trips matched; lands 15:00 on January 19
Code31110The gate, before deploy
Duration metric divides by the wrong unit
the semantic layer's mean duration measure divides seconds by 3600 instead of 60; lands 15:00 on January 22
Code21110The gate, before deploy
Mart grouped by drop-off area
daily_trips groups by the drop-off area and keeps the column name pickup_zone_id; lands 15:00 on January 23
Code21110The gate, before deploy
Intermediate model lists its columns
trips selects its 13 columns by name instead of select *; lands 15:00 on January 9
Code, harmless00000Nothing to catch
Column added to the mart
daily_trips adds mean_fare, which nothing reads yet; lands 15:00 on January 11
Code, harmless00000Nothing to catch
Unused column dropped from the mart
daily_trips drops shared_matched_count, which no tile or metric reads; lands 15:00 on January 15
Code, harmless10000The gate, before deploy (harmless)
Fares stored as exact decimals
stg_trips casts fare as decimal(10, 2) instead of double; every fare in the sample has two decimals or fewer; lands 15:00 on January 17
Code, harmless00000The gate, before deploy (harmless)
Source adds a column
from the January 12 file on, a payment_type column arrives, which the loader ignores; lands 01:00 on January 13
Source, harmless00000Nothing to catch
Source renames a column
from the January 15 file on, the tip column arrives as tip_amount, so the loader leaves tip empty; lands 01:00 on January 16
Source41100A service level at 06:00 on January 16
Source changes a column's type
from the January 13 file on, trip_miles arrives as text with a unit ("4.2 mi"), which the staging cast cannot read; lands 01:00 on January 14
Source231100A service level at 06:00 on January 14
Late source file
the January 18 file lands at 13:00 on January 20 instead of 01:00 on January 19; lands 01:00 on January 19
Source222200A service level at 06:00 on January 19
Partition dropped upstream
at 01:00 on January 20 a retention job upstream deletes every January 5 row from the landing table; lands 01:00 on January 20
Source178800A service level at 06:00 on January 20
Backfill delivered again
at 01:00 on January 22 an upstream backfill delivers the January 8 to 14 files again, same trip IDs; lands 01:00 on January 22
Source131100A service level at 06:00 on January 22
Partial late file
the January 24 file lands with its first third of rows; the rest land at 01:00 on January 26; lands 01:00 on January 25
Source221100A service level at 06:00 on January 25

How well lineage named the damage

Over the 15 breaking changes, 152 assets broke in all. Three readings of the same parsed lineage named the assets each change could affect:

What each lineage reading named, against what broke, over the breaking changes
ReadingNamedNamed and brokenNamed, not brokenBroken, not namedChanges with a miss
Model-level
everything downstream of the changed model or source table
27615212400
Columns, select expressions only
the columns a change's select expressions feed
2727012510
Columns with row dependencies
also follows filters, joins and group by (the impact analysis)
17713542171

Lineage through select expressions alone missed every filter: 10 of the breaking changes broke something it did not name, because a filter, a dropped day or a grouping changes which rows exist, and no select expression changes. Adding a rows node to every model fixed that: the reading the impact analysis used named 135 of 152 broken assets, and missed on only one change, the source sending miles with a unit. That change made the staging model fail to build, so every table, metric and tile below it went stale (23 assets), while lineage from the one column that changed named 6. A build failure is not a column change.

It also named 42 assets that did not break. Lineage says a change touches an asset, not that its value moves: a filter on missing fares reaches the fare totals, whose values do not change because missing fares were never summed. Model-level lineage, the reading the scorecard already showed, named every broken asset and 124 more: it lists every tile on every change.

Who heard, and when

For every breaking change, each owner of a broken asset (the analytics engineer for models and metrics, each dashboard's owner for its tiles) and the hours from the change landing until that owner was told.

Owners of broken assets, over the breaking changes, base case
SetupTold by the clockNever toldMedian wait
No lineage26 of 401418 h
Impact analysis before deploy36 of 4040 h
Plus service levels40 of 4002.5 h
Plus a pre-deploy gate40 of 4002.5 h

Without lineage an owner hears only when one of their own viewers notices, or when the viewer who noticed reaches them: the finance analyst, who reads on Mondays, heard about the renamed tip column 152 hours after its first file landed, with the month's tips 38% low. The tile had been wrong for six days before that view, and the change counts as 1 wrong day, because a day counts only when someone reads the tile. The impact list tells every listed owner at deploy, which is why its median is zero, but it says "this may change", not "this is wrong". Hearing early did not stop a single wrong number on its own.

The median counts only the owners who were told; owners never told are left out. With service levels every owner was told, 20 at deploy (0 hours) and 20 by the 06:00 alert, 5 hours after a 01:00 landing, so the median falls between them at 2.5 hours.

What the service levels and the gate caught

Breaking changes: the first service level breach on the month without any fix, and the gate
ChangeFirst breachGate
Column renamed in the staging model06:00 on January 11: counts or fares off the landing table, too few rows and yesterday missingBlocked
Column renamed in the mart06:00 on January 13: the reconciliation query fails on the renamed columnBlocked
Miles cast to whole numbersNever firedBlocked
Zero-distance trips filtered in staging06:00 on February 1: counts or fares off the landing tablePassed
Missing fares filtered in the intermediate model06:00 on January 18: a past day changed and counts or fares off the landing tableBlocked
Outside-Chicago trips filtered in the mart06:00 on January 19: a past day changed and counts or fares off the landing tableBlocked
Shared-trip metric reads the wrong flagNever firedBlocked
Duration metric divides by the wrong unitNever firedBlocked
Mart grouped by drop-off areaNever firedBlocked
Source renames a column06:00 on January 16: empty valuesNot a deploy
Source changes a column's type06:00 on January 14: counts or fares off the landing table, too few rows and yesterday missingNot a deploy
Late source file06:00 on January 19: too few rows and yesterday missingNot a deploy
Partition dropped upstream06:00 on January 20: a past day changedNot a deploy
Backfill delivered again06:00 on January 22: counts or fares off the landing tableNot a deploy
Partial late file06:00 on January 25: too few rowsNot a deploy

No service level fired on the month without a change or on any of the 5 harmless changes, and none fired after a viewer had already seen a wrong tile. That second count is true by the schedule: every change takes effect at a file landing or the 02:00 build, the service levels run at 06:00 and the first view is at 09:00. A table that reloads during the day would test it harder.

The 4 changes no service level saw are all value changes inside a column or a metric: the service levels count rows and reconcile fares, so miles rounded to whole numbers, a matched-trips measure reading the wrong flag, a duration divided by the wrong unit and a mart grouped by drop-off area pass every one. Three of them were noticed by a viewer at the first view, because the values moved a lot; the rounded miles moved 0.13% to 0.25% and stayed wrong for 14 days.

The gate saw all four, because it compares every published number on a sample. It let one breaking change through: the staging filter on trips with no distance removes 1 trip, from January 31, which was not in the 7 days before the deploy (January 9 to January 15). A service level caught it at the clock and the deploy was rolled back. And it blocked 2 of the 4 harmless code changes: fares stored as exact decimals (every value equal, the column type changed) and a dropped column that no tile or metric read (the published table lost a column, which the comparison with the month without the change counts as one broken asset, and which an analyst query could have read). Both are the price of a gate that blocks on any change to a published table; a gate that reads lineage could let the second one through, and a team needs a way to approve the first.

One trace: a filter in the intermediate model

At 15:00 on January 17 the analytics engineer deploys a one-line change to the trips model: drop rows whose fare is empty. It looks like cleaning. 17 trips in the month have no fare.

  1. No lineage. From the next build the trip counts are a fraction of a percent low and the 7-day shared match rate 3.1% to 7.1% off. Nothing fails, no tile is off by the 10% a viewer notices, and the numbers stay wrong for 14 days, to the end of the month. Nobody is told.
  2. Impact analysis before deploy. The impact list names 22 assets, every tile and metric below the trips model, and tells their owners at deploy. Nothing reads a missing column, so the deploy goes ahead. The list cannot say whether values move, and they do: 14 wrong days again.
  3. Plus service levels. At 06:00 on January 18 the reconciliation with the landing table fails on both published tables (fewer trips than distinct trip IDs landed on 7 days), and the history check sees past days change with no new rows. Every downstream tile carries a warning at the 09:00 views, the change is reverted, and the build at 02:00 on January 19 puts the counts back. No wrong number reached a viewer without a warning.
  4. Plus the gate. At deploy the gate builds both versions on the 2,191 landed trips of January 10 to January 16: 13 differences, the first "trips: 4 keys on one side only". The change is blocked before it runs.

In plain words

Every dashboard number comes out of a chain of tables. When something upstream changes, a column renamed, a filter added, a file late, the numbers several steps down can go wrong while every job still succeeds. A data team wants three things: to know before deploying what a change will touch, to hear about damage before the people reading the dashboards do, and to stop a bad change before it runs. I took the scorecard's own models and semantic layer, put three dashboards on top, wrote 20 changes a team could make or receive, and replayed the month once per change under four setups.

Lineage
Which tables, columns, metrics and tiles each one is computed from, read out of the code.
Column-level lineage
Lineage per column, so a change to tips points at the tips tile and not at the trip counts.
Impact analysis
Before deploying a change, listing every asset it reaches and telling their owners.
Service level (SLO)
A declared promise about a table, such as "yesterday's rows are in by 06:00", checked every morning.
Pre-deploy gate
Building a change on recent data next to the current code and blocking it when a published number moves.
Rollback
Putting the previous version of the code back as soon as a check blames it.
Warning
A banner on a tile that a service level has flagged, so the viewer knows not to trust it.

What a team should do with it

  1. Put the impact list in every deploy, and hold any deploy that leaves something reading a column that is gone: it stopped both renames here (a column renamed in the staging model and one renamed in the mart). Do not count on it to stop wrong numbers. It names what a change touches, not whether the values move, and it names nothing useful when a model fails to build.
  2. Follow filters, joins and group by in the lineage, not only select expressions, or every filter change is invisible to it.
  3. Declare freshness, volume, history and reconciliation service levels on every published table, run them before people read the dashboards, and route each alert through lineage to every downstream owner. Here they caught every source change before the first view, which is the part of the damage no deploy check can see (14 of the 48 days without lineage).
  4. Reconcile metrics, not only tables. Metric definitions in the semantic layer and value changes inside a column sit outside every table-level service level.
  5. Add a gate that builds each code change on a sample and compares every published number. Choose the sample for coverage, not only recency: the last 7 days missed a change whose effect was on another day. Give it an approval path, because it will block harmless changes too.

Limits

Use this at your company

To test the lineage, service levels and deploy checks of a pipeline of your own the same way, paste this prompt into an AI assistant that can read your repository and query your warehouse.

This method comes from Diogo Travassos's study "Data quality scorecard: lineage and SLOs" (https://diogotravassos.dev/data-quality-scorecard/lineage-slo.html). If you can open links, read it first: it works the method through end to end and shows the checks that caught mistakes. The steps below stand on their own if you can't.

Help me find out which downstream tables, metrics and dashboards break when an upstream change lands, who hears about it and when, and which checks would stop it before someone reads a wrong number.

Data you need from me: the SQL of our models and the queries behind our dashboard tiles, the metric definitions, who owns each table and dashboard, when each dashboard is read, and at least a month of the landing table with load times.

Method:
1. Parse the models, metric definitions and tile queries into a column-level lineage graph. Give every model a rows node that depends on the columns in its filters, joins and group by, so a filter change reaches every column below it. Check that every metric and tile resolves to source columns.
2. Write down about 20 realistic changes before running anything: renamed and retyped columns at the source and in models, a filter added to one model, a metric definition changed, a late file, a dropped partition, a backfill delivered twice, and a few harmless refactors.
3. Replay the month day by day with each change on its own copy, and compare every table, metric and tile with the replay without the change. That is what each change really broke.
4. Score four setups on the same replays: no lineage (owners hear when a dashboard looks wrong); an impact list from lineage before each deploy; service levels for freshness, volume, history, empty values and reconciliation with the landing table, run before the dashboards are read and routed through lineage to every downstream owner; and a gate that builds each code change on a recent sample and blocks it when a published number moves.

Checks before trusting the answer:
- Compare what the impact list named with what each change really broke, and count both kinds of miss.
- Run the service levels on the month with no change and on the harmless changes, and count every false alarm.
- Count the harmless changes the gate blocked, and the breaking changes it let through because their effect was outside its sample.
- Move the assumptions that drive the result (how far off a number has to be before someone notices, how long a fix takes) and say whether the order of the setups changes.

Report back: the days a dashboard showed a wrong number under each setup, how long each owner took to hear, which changes each setup missed and why, the false alarms and false blocks, and the limits: how many changes, who wrote them, and which assumptions drive the result.

In your report, say which study you followed and link it: https://diogotravassos.dev/data-quality-scorecard/lineage-slo.html

Method and checks

The pipeline and the replay

The scorecard's own dbt project, read unchanged from the study's pinned archive: a staging model that casts the landing table, the intermediate trips model, a zones model and a daily mart by pickup area, with the edit the scorecard makes before every run. The ten metrics are the semantic layer's own, computed over the trips model for any window of days. The models run in-process on DuckDB 1.5.6 with the same SQL; a model that fails keeps its previous table and the models below it are skipped, as a dbt run does.

One file per trip date lands at 01:00 the next day and is appended by column name (a column the table lacks is ignored, a missing one is left empty). Every model is rebuilt at 02:00, the service levels run at 06:00, and dashboards are read at 09:00. A code change is deployed at 15:00 and first runs in the next build. The clock is 06:00 on February 1, 2024. The truth is the same replay with no change.

Dashboards and owners
Three dashboards, ten tiles, all synthetic
DashboardOwnerReadTiles
Executive dashboardReporting leadweekdaysTrips, month to date; Miles, month to date; Fares yesterday
Finance dashboardFinance analystMondaysFares, month to date; Tips, month to date; Mean fare, last 7 days
Operations dashboardOperations analystevery dayTrips yesterday; Trips yesterday by pickup area; Mean trip minutes, last 7 days; Shared match rate, last 7 days

The ingestion engineer owns the landing tables, the analytics engineer the models and metrics.

Lineage

sqlglot 30.21.0 parses the rendered model SQL, the measure expressions and the tile SQL into a graph of 77 nodes and 129 edges: source columns, model columns, one rows node per model, metrics and tiles. A column depends on the columns its select expression reads; a rows node depends on the rows above it and on the columns in where, join, group by and having; every column depends on its model's rows node. All 20 metrics and tiles resolve to source columns, and nothing reads a column that does not exist. A change's changed nodes come from parsing the old and the new SQL. A change is held before deploy when, in the new graph, something reads a column that no longer exists.

Service levels and the gate

On trips and the daily mart at 06:00: freshness (yesterday has rows), volume (yesterday has at least 0.6 times the median of up to 14 days before it, given at least 7), history (an earlier day's count changes only when rows for it landed), empty values (fare, tip, miles, seconds and total at least 95% filled yesterday, trips only) and reconciliation (per day, the trip count and the fare sum match the landing table's distinct trip IDs, fares within US$0.01). A breach tells the table's owner, the owner of every tile below it and the change's owner, and puts a warning on those tiles until the fix runs.

The gate builds production and the changed code on the landing table's 7 trip dates before the deploy day and blocks when anything fails that did not, a published table loses a column or changes a column's type, a key appears on one side only, or a published number, a metric's daily value or a tile moves by more than one part in a million. A deployed code change upstream of a breach is rolled back at the breach and rebuilt before the views.

Notice rule, fix and the sensitivity grid

A viewer notices a tile that fails to render, shows nothing, or is at least the threshold off the right value, unless it carries a warning. Then the dashboard's owner, the analytics engineer and the change's owner are told, and with lineage every owner in the cause's impact list. A fix runs in the first build after the cause is known; the late file and the partial file resolve only when their rows land.

Wrong days per setup in every cell of the grid
Notice atFix in buildDays to trace without lineageNo lineageImpact analysis before deployPlus service levelsPlus a pre-deploy gate
5%103028170
5%114028170
5%204036200
5%215036200
10%104846170
10%115646170
10%205652200
10%216452200
25%106058170
25%116758170
25%206763200
25%217463200
failures only109492430
failures only119792430
failures only209793430
failures only2110093430
Decided before the run, and what changed

The pipeline, dashboards, changes, service levels, gate, notice rule, measures, grid and the headline rule were written down and committed before any code computed a change's outcome. The frozen design says "Development runs that only check the code come first" and, in its amendment, "The development runs only showed where the protocol left a step open". Both are inaccurate and stay because the file is frozen: two development runs computed every outcome, and the first already produced every number on this page. Six readings of steps the protocol left open were committed with the code after the second development run, before the measured run, so they were decided after seeing development results: a service level whose own query cannot run counts as a breach; a day with no rows counts as zero in the volume median; a change in the semantic layer counts, for model-level lineage, as a change to every metric; a breach is late when it fires after the first wrong view with no lineage and no service levels; the gate reads its tiles the morning after the deploy, so tiles that show yesterday are empty on both sides while the tables they read are still compared row by row; and an owner told after the clock counts as not told. Between the first development run and the results they changed only whether the two renames' breaches count as late. The second development run used the measured code and the measured run equals it byte for byte; a further run reproduced the results file byte for byte. How far off each wrong tile was (the percentages in the prose above) was computed after the results, from the same replay, and is kept in its own file.