Commit e434d44
affsantos
feat: focused profiling — only profile changed columns
For wide models (100+ columns), data-diff now profiles only the columns
that actually changed, using sqlglot AST analysis. This reduces BQ
compute by ~90% for typical changes to wide models.
How it works:
- parse_columns.py identifies added_columns + expression_changes
- is_cte_change_additive() classifies CTE modifications:
- Additive (new LEFT JOINs, new columns) → safe for focused profiling
- Structural (WHERE/filter/JOIN changes) → falls back to full profiling
- EXCEPT DISTINCT row comparison always covers ALL columns as safety net
- --full flag to override and profile everything
Also syncs upstream improvements:
- data-diff.sh: get_affected_columns() helper, column filter in
build_profile_query(), profiling mode tracking per model
- template.html: focused profiling banner, skip-row styling for
non-profiled columns (shown as — instead of misleading zeros)
- SKILL.md: document --full flag and focused profiling behavior1 parent 491d738 commit e434d44
5 files changed
Lines changed: 506 additions & 73 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
56 | 65 | | |
57 | 66 | | |
58 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
56 | 78 | | |
57 | 79 | | |
58 | 80 | | |
| |||
61 | 83 | | |
62 | 84 | | |
63 | 85 | | |
64 | | - | |
65 | | - | |
| 86 | + | |
| 87 | + | |
66 | 88 | | |
67 | 89 | | |
68 | | - | |
| 90 | + | |
| 91 | + | |
69 | 92 | | |
70 | 93 | | |
71 | 94 | | |
| |||
0 commit comments