Skip to content

fix: resolve physicalName for slaProperties freshness/retention checks - #1522

Open
aabf wants to merge 1 commit into
datacontract:mainfrom
aabf:fix/freshness-retention-physicalname
Open

fix: resolve physicalName for slaProperties freshness/retention checks#1522
aabf wants to merge 1 commit into
datacontract:mainfrom
aabf:fix/freshness-retention-physicalname

Conversation

@aabf

@aabf aabf commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • _freshness_check/_retention_check in create_checks.py built CheckSpec.model from the raw sla.element model segment, while schema checks already resolve through to_schema_name() (physicalName fallback).
  • Whenever a schema object's name differs from its physicalName, the servicelevel check failed at execution time with Could not read model '<name>', since the ibis engine resolves tables by physicalName.
  • This PR makes freshness/retention checks resolve the model the same way schema checks do: to_schema_name(schema_object, server_type).

This addresses suggestion 1 from the Slack thread repro (split out from suggestion 2, nested-field element support, per Jakob's request to keep the two independent).

Test plan

  • Added tests/test_create_checks_servicelevel.py covering physicalName resolution and fallback-to-name for both freshness and retention checks
  • pytest tests/test_create_checks_servicelevel.py tests/test_create_checks_sql_placeholders.py tests/test_create_checks_nested_type.py tests/test_create_checks_primary_key.py tests/test_create_checks_physical_type.py tests/test_test_dimension_filter.py tests/test_test_metadata_only.py — 83 passed
  • ruff check / ruff format --check clean

Freshness/retention CheckSpec.model was built from the raw sla.element
model segment, while schema checks already resolve through
to_schema_name() (physicalName fallback). Whenever a schema object's
name differs from its physicalName, the servicelevel check failed at
execution with "Could not read model" because it targeted the logical
name instead of the real table.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant