Repository navigation
[FPv2: Foundation] Define semantic inputs and metadata exclusions - #2750
Conversation
93d9903 to
ad924b9
Compare
[Low impact] This PR appears safe to merge; no new actionable issues were found. SummaryDefines local inputs for v2 fingerprints without changing the active fingerprint engine.
No new actionable issues were found. Reviews (3) · Last reviewed commit: "Format semantic contract tests for CI" · Reviewed by Greptile |
2efee0b to
bffc827
Compare
| required_dimensions=sorted(spec.rendered_required_dimensions), | ||
| fixed_grain=( | ||
| sorted(spec.rendered_fixed_grain) |
There was a problem hiding this comment.
For the sake of correctness let's do sorted(set(...)) here, instead of just sorted(...).
Also, let's use canonical_required_dimensions here instead of rendered_required_dimensions. Otherwise if we have:
SELECT SUM(id) FROM ns.sourceThen these would have different fingerprints though semantically they are the same:
required_dimensions = ["id"]required_dimensions = ["ns.source.id"]
There was a problem hiding this comment.
Similarly, for fixed_grain we should use normalize_fixed_grain(spec.rendered_fixed_grain).
There was a problem hiding this comment.
Agreed on deduping and using normalize_fixed_grain.
I’m not so sure I agree on using canonical_required_dimensions as-is. Let’s take the following case:
SELECT SUM(o.amount)
FROM ns.orders o
JOIN ns.customers c ON o.customer_id = c.idIn this example, required_dimensions = ["ns.orders.id"] and ["ns.customers.id"] both normalize to ["id"]. But grouping by order ID versus customer ID can produce different results, so those should remain distinct in the fingerprint.
There was a problem hiding this comment.
I think actually we can just limit the normalization to unambiguous cases for noise reduction
There was a problem hiding this comment.
OK, fixed by deduping required dimensions and using normalize_fixed_grain.
I limited name normalization to simple queries with one table, so id and ns.source.id match there, while orders.id and customers.id stay distinct in the join example.
There was a problem hiding this comment.
Ah, you're right about canonical_required_dimensions! I didn't think of that.
e114164 to
2b2ca79
Compare
2b2ca79 to
f50b1d2
Compare
ebf1e07 to
ced5526
Compare
f50b1d2 to
8e12c9d
Compare
✅ Deploy Preview for thriving-cassata-78ae72 canceled.
|
Foundation PR for fingerprints v2:
Editing a column's description can currently change downstream fingerprints even though the data is unchanged.
This PR defines which node fields fingerprints v2 will use. Descriptions, display names, tags, ownership, and custom metadata are excluded. Fields such as column types, source tables, join rules, and default filters remain inputs.
Later PRs will use these rules when calculating fingerprints.