[DJ Semantic Fingerprint 3] Add semantic fingerprints to deployment impact - #2483
[DJ Semantic Fingerprint 3] Add semantic fingerprints to deployment impact#2483philipfweiss wants to merge 11 commits into
Conversation
da0a6ef to
1783278
Compare
1c628be to
d914195
Compare
1783278 to
de5ed41
Compare
63bf44c to
638e8b5
Compare
1ebbd8d to
a7a25ff
Compare
84419d8 to
1d4520e
Compare
Return server-owned fingerprints and change tiers for deployment results and downstream impacts, including client parsing and unknown-state propagation.
Impact tests now derive expected hashes from complete graph snapshots, matching production parent resolution.
Recover per node during impact analysis so invalid SQL can produce unknown fingerprints without weakening normal deployment parsing.
1d4520e to
52d4f75
Compare
✅ Deploy Preview for thriving-cassata-78ae72 canceled.
|
Canonicalize required-dimension identities during change detection so equivalent metric specs remain no-ops, and align deployment assertions with the additive fingerprint response fields.
Preserve namespace rendering during semantic comparison so unchanged deployments remain no-ops.
| metric_revision.id == BoundDimensionsRelationship.metric_id, | ||
| ) | ||
| .join(Node, Node.id == metric_revision.node_id) | ||
| .where(parent_revision.node_id.in_(frontier_ids)) |
There was a problem hiding this comment.
metric_revision is pinned to Node.current_version below, but parent_revision is not, so a column belonging to a stale parent revision can still pull its metric into the frontier. The dimension-link query just above pins, so should this one match it in behavior?
There was a problem hiding this comment.
I think the current behavior is intentional. A metric can still depend on an older revision of a dimension column. If we only consider the dimension’s current revision, we could miss that dependency and fail to mark the metric as affected. I’ll add a test to make this behavior clear.
| extract_dimension_refs_from_filters, | ||
| ) | ||
|
|
||
| rows = ( |
There was a problem hiding this comment.
I might be missing something, but it looks like the rows query will end up loading every non-deactivated cube's filters? As in, it's not filtering to whether a cube is in a set of ids (e.g., a cube is either within or downstream of the deployment). This query could be skipped if there are no downstream cubes, but also limited to the ones that are affected by the deployment.
There was a problem hiding this comment.
You’re right that this scans all active cubes. We can’t limit it to cubes already identified as downstream because this query is what discovers cubes affected only through filters...
That being said, it shouldn't be too bad of a cost, roughly proportional to the total number of cube filters. It is one query per deployment with changes, so I expect the cost to be pretty modest.
/deployments/impactreports operations and changed fields without a server-owned semantic identity. Metadata consumers otherwise have to repeat DJ's classification, SQL handling, and graph traversal.Depends on #2488.
This PR:
change_tierandsemantic_fingerprintfieldsdeploy_typeand parses old and new response shapes in the Python clientImpact propagation example
flowchart LR X{"orders table changes"} S["source: orders<br/>object hash: h_orders to h_orders_next<br/>operation: update<br/>direct tier: major"] T["transform: clean_orders<br/>object hash: h_clean_orders to h_clean_orders_next<br/>operation: noop<br/>direct tier: none"] M["metric: order_count<br/>object hash: h_order_count to h_order_count_next<br/>operation: noop<br/>direct tier: none"] C["cube: orders_cube<br/>object hash: h_orders_cube to h_orders_cube_next<br/>operation: noop<br/>direct tier: none"] X --> S S ==>|h_orders changed| T T ==>|h_clean_orders changed| M M ==>|h_order_count changed| C classDef direct fill:#fff1d6,stroke:#c2410c,color:#431407 classDef propagated fill:#dbeafe,stroke:#2563eb,color:#172554 class S direct class T,M,C propagatedThe metadata rows become
source::orders::h_orders_next,transform::clean_orders::h_clean_orders_next,metric::order_count::h_order_count_next, andcube::orders_cube::h_orders_cube_next. All four CODEOWNERS are therefore included in review.Verification:
Started this branch on development slot 1:
Then deployed a source, transform, and metric before changing only the source table and calling
POST /deployments/impact:Observed:
{ "status": 200, "results": [ { "name": "fingerprint_verification.transform", "operation": "noop", "change_tier": "none", "semantic_fingerprint": { "version": 1, "digest": "396e92df092afb466e34ef038b4bd6b2987b6ec09b1f39700f5d1cbf649e3c71" }, "hash_changed": true }, { "name": "fingerprint_verification.metric", "operation": "noop", "change_tier": "none", "semantic_fingerprint": { "version": 1, "digest": "3f6230e34838ea84ca8cd10ce6b4049b45b3ff79cf2e9840a419ade1731d19d2" }, "hash_changed": true }, { "name": "fingerprint_verification.source", "operation": "update", "change_tier": "major", "semantic_fingerprint": { "version": 1, "digest": "dd0e10eeead298cdb31af85f3ccd3dac98760564c4d1f97473eb25bc5d024e98" }, "hash_changed": true } ] }Semantic fingerprint stack
This is PR 3 of 4: