Commit 671c150
feat(snowflake): plottable numeric metadata across workspace + Wave 3
Dagster auto-charts MetadataValue.int/float fields on each asset's Plots
tab over time. Wiring numeric metadata into every Snowflake materialization
turns each demo run into a per-asset time series of duration, rows, bytes,
credits, partition pruning.
New module-level _emit_query_perf(cursor, query_id) helper added to:
- integrations/snowflake_workspace/component.py
- assets/data-warehouse/snowflake_task_execute_asset/component.py
- assets/data-warehouse/snowflake_dynamic_table_refresh_asset/component.py
- assets/data-warehouse/snowflake_stored_procedure_call_asset/component.py
Helper queries TABLE(INFORMATION_SCHEMA.QUERY_HISTORY_BY_QUERY_ID(...))
for cursor.sfqid (the just-executed query) and returns 7 plottable
fields under a stable snowflake/* namespace:
- snowflake/query_duration_ms (MetadataValue.int)
- snowflake/rows_produced (MetadataValue.int)
- snowflake/bytes_scanned (MetadataValue.int)
- snowflake/bytes_spilled_local (MetadataValue.int)
- snowflake/credits_used (MetadataValue.float)
- snowflake/partitions_scanned (MetadataValue.int)
- snowflake/partitions_total (MetadataValue.int)
Returns {} on any failure so callers can blindly metadata.update(...)
without risking the materialization itself.
Wired after EXECUTE TASK / CALL / ALTER DYNAMIC TABLE REFRESH / ALTER
MV RESUME / ALTER EXTERNAL TABLE REFRESH / ALTER PIPE REFRESH across:
Workspace component (multi-entity):
- _task_asset: perf after EXECUTE TASK
- _make_proc_asset: perf after CALL
- _dynamic_table_asset: perf after REFRESH + rows/bytes as MetadataValue.int
- _mv_asset: perf after RESUME + rows/bytes as int
- _external_table_asset: perf after REFRESH + rows as int
- _snowpipe_asset: perf after REFRESH + parses SYSTEM$PIPE_STATUS
JSON for pending_file_count + execution_state, plus recent_loads count
- _stream_asset: rewritten as proper ObserveResult with
snowflake/has_data (0/1 int) + snowflake/pending_rows (int)
- _stage_asset: rewritten as proper ObserveResult with
snowflake/file_count (int) + snowflake/total_bytes (int)
Wave 3 single-entity:
- snowflake_task_execute_asset: perf after EXECUTE TASK
- snowflake_dynamic_table_refresh_asset: perf after REFRESH + rows/bytes
as int
- snowflake_stored_procedure_call_asset: perf after CALL
The result: every materialized Snowflake asset gets a Performance time
series in Dagster's catalog without any customer config. Demo-impressive:
bytes scanned trending up over a week, query duration spiking before a
refactor, partition pruning ratio, credits-per-run, etc.
L1 validation harness scorecard unchanged:
PASS: 562 WARN: 0 FAIL: 41
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 1ced5bf commit 671c150
6 files changed
Lines changed: 287 additions & 33 deletions
File tree
- assets/data-warehouse
- snowflake_dynamic_table_refresh_asset
- snowflake_stored_procedure_call_asset
- snowflake_task_execute_asset
- dagster_community_components
- integrations/snowflake_workspace
Lines changed: 42 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
26 | 60 | | |
27 | 61 | | |
28 | 62 | | |
| |||
119 | 153 | | |
120 | 154 | | |
121 | 155 | | |
| 156 | + | |
122 | 157 | | |
123 | 158 | | |
124 | 159 | | |
125 | 160 | | |
126 | 161 | | |
127 | 162 | | |
128 | 163 | | |
| 164 | + | |
| 165 | + | |
129 | 166 | | |
130 | 167 | | |
131 | 168 | | |
| |||
146 | 183 | | |
147 | 184 | | |
148 | 185 | | |
149 | | - | |
150 | | - | |
151 | 186 | | |
152 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
153 | 193 | | |
154 | 194 | | |
155 | 195 | | |
| |||
Lines changed: 40 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
23 | 57 | | |
24 | 58 | | |
25 | 59 | | |
| |||
141 | 175 | | |
142 | 176 | | |
143 | 177 | | |
| 178 | + | |
144 | 179 | | |
145 | | - | |
| 180 | + | |
146 | 181 | | |
147 | 182 | | |
148 | 183 | | |
149 | 184 | | |
150 | 185 | | |
151 | 186 | | |
152 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
153 | 191 | | |
154 | 192 | | |
155 | 193 | | |
| |||
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
28 | 65 | | |
29 | 66 | | |
30 | 67 | | |
| |||
121 | 158 | | |
122 | 159 | | |
123 | 160 | | |
| 161 | + | |
124 | 162 | | |
125 | 163 | | |
| 164 | + | |
126 | 165 | | |
127 | 166 | | |
128 | 167 | | |
| |||
140 | 179 | | |
141 | 180 | | |
142 | 181 | | |
| 182 | + | |
| 183 | + | |
143 | 184 | | |
144 | 185 | | |
145 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments