Resolve physicalName in servicelevel freshness and retention checks - #1489
Open
erikgrip2 wants to merge 1 commit into
Open
Resolve physicalName in servicelevel freshness and retention checks#1489erikgrip2 wants to merge 1 commit into
erikgrip2 wants to merge 1 commit into
Conversation
The engine's freshness/retention checks read the relation by the schema object's logical name; the sodacl exporter emitted its servicelevel blocks the same way. Both now resolve the object's and property's physicalName like the schema checks do. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1488.
datacontract test's freshness and retention checks read the relation by the schema object's logicalname; every other check resolvesphysicalNameviato_schema_name(). A contract whose object name differs from the relation name — e.g. a versioned dbt model, aliased to<model>_v<n>— failed while all schema checks in the same run passed against the correct relation:datacontract export sodaclemitted its servicelevel blocks under the logical name the same way.Changes
_resolve_sla_elementhelper folds the element split, the model existence gate, and name resolution — the object viato_schema_name()(keeping the kafka carve-out, which reads the Spark SQL view by logical name), the property via itsphysicalName. Both_freshness_checkand_retention_checkuse it._resolve_physical_nameshelper of the same shape, used by both servicelevel builders.physicalName, so the e2e can distinguish "measured and stale" from "could not read the table"; it now also asserts the freshness diagnostics (age_seconds).Behavior notes
Check.modeland the check display name) — consistent with what schema checks already report, but different from thesla.elementspelling.--filter/--filters) now apply to servicelevel checks whenphysicalNameis set. Filters are normalized into a mapping keyed by physical name, and the servicelevel specs' logical-name key never matched, so they silently ran unfiltered.physicalNamealready fails every schema check there; servicelevel checks now fail consistently with them instead of accidentally measuring the logical-name view. (Whether those views should be created viato_schema_name()instead may deserve a separate look.)No change for contracts where
physicalNameis unset or equals the name.Testing
Could not read model '<logical name>'and passes post-fix with freshness measurement diagnostics.uv run pytest)uv run ruff check --fix && uv run ruff format)🤖 Generated with Claude Code