Skip to content

fix: properly check for unapplied tblproperties configs in existing r… - #1350

Merged
sd-db merged 9 commits into
databricks:mainfrom
canbekley:fix/tblproperties-diff-check
Jun 23, 2026
Merged

fix: properly check for unapplied tblproperties configs in existing r…#1350
sd-db merged 9 commits into
databricks:mainfrom
canbekley:fix/tblproperties-diff-check

Conversation

@canbekley

Copy link
Copy Markdown
Contributor

Resolves #1314

Description

Aquiring TblProperties changesets is highly error-prone and not scalable. The old code filtered out Databricks-internal properties (like delta.minReaderVersion, clusteringColumns, etc.) when reading from the relation from a static "ignore list" that needed to be updated continuously. With the new approach, from_relation_results now includes all properties from the relation. Since get_diff only looks at what config tblproperties are currently missing or incorrect, these extra databricks-internal properties in other are harmless, they'll never appear in the diff.

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.

…elation

Signed-off-by: Can Bekleyici <can.bekleyici@deepl.com>
@canbekley
canbekley force-pushed the fix/tblproperties-diff-check branch from 091b4b7 to d3abbbe Compare May 8, 2026 09:29
@canbekley
canbekley requested a review from jprakash-db as a code owner May 8, 2026 09:29
@TiPPeX2

TiPPeX2 commented Jun 21, 2026

Copy link
Copy Markdown

Cool,
Is there something that holds us back here :) ?
@sd-db ?

Resolve conflict in relation_configs/tblproperties.py: keep the new set-diff
get_diff() approach over main's ignore_list. main's databricks#1489 added
delta.parquet.compression.codec to the ignore_list; that property is now
handled automatically by the set-only diff, so the ignore_list is dropped
entirely.
sd-db added a commit to canbekley/dbt-databricks that referenced this pull request Jun 22, 2026
Move the entry out of the released 1.11.6 section (where the main merge stranded
it) into 1.12.2 (TBD). Reclassify under Fixes since it closes databricks#1314 (materialized
views always rebuilding) and add the PR + closing-issue links.
…_results

After dropping the ignore_list, from_relation_results retains all properties
(including server-set ones like clusterByAuto, clusteringColumns, and
delta.parquet.compression.codec). Update test_incremental_config to expect the
now-captured properties, and replace test_from_results__drops_ignored_properties
with a retention test plus a get_diff test that guards the same guarantee databricks#1489
cared about (server-set properties never register as a change).
sd-db added a commit to canbekley/dbt-databricks that referenced this pull request Jun 22, 2026
Move the entry out of the released 1.11.6 section (where the main merge stranded
it) into 1.12.2 (TBD). Reclassify under Fixes since it closes databricks#1314 (materialized
views always rebuilding) and add the PR + closing-issue links.
@sd-db
sd-db force-pushed the fix/tblproperties-diff-check branch from 91538be to 7f758a7 Compare June 22, 2026 19:00
sd-db added 3 commits June 23, 2026 09:40
Move the entry out of the released 1.11.6 section (where the main merge stranded
it) into 1.12.2 (TBD). Reclassify under Fixes since it closes databricks#1314 (materialized
views always rebuilding) and add the PR + closing-issue links.
…nge tests

The _check_tblproperties helper filtered the relation's tblproperties by
TblPropertiesConfig.ignore_list, which this PR removes — it would raise
AttributeError once the PR lands. from_relation_results now returns all
properties, so scope the comparison to the keys the model configures instead.
Verified live: TestMaterializedViewApplyChanges + TestStreamingTableChangesApply
(7 passed) on databricks_uc_sql_endpoint.
@sd-db
sd-db force-pushed the fix/tblproperties-diff-check branch from 7f758a7 to e9f6ca8 Compare June 23, 2026 04:12
@sd-db

sd-db commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

/integration-test

@github-actions

Copy link
Copy Markdown

Integration tests dispatched for PR #1350 by @sd-db. Track progress in the Actions tab.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  dbt/adapters/databricks/relation_configs
  tblproperties.py 41
Project Total  

This report was generated by python-coverage-comment-action

@github-actions

Copy link
Copy Markdown

Integration results for PR #1350 — UC cluster ❌ failure · SQL warehouse ❌ failure · All-purpose cluster ❌ failure · Shard coverage ✅ success

Run details.

@sd-db

sd-db commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

/integration-test

@github-actions

Copy link
Copy Markdown

Integration tests dispatched for PR #1350 by @sd-db. Track progress in the Actions tab.

@github-actions

Copy link
Copy Markdown

Integration results for PR #1350 — UC cluster ✅ success · SQL warehouse ✅ success · All-purpose cluster ✅ success · Shard coverage ✅ success

Run details.

@sd-db sd-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the PR, I have done some changes to fix a bug that might have affected STs + added tests. Overall looks good !!

sd-db added 2 commits June 23, 2026 17:22
…fresh

get_diff returned only the unapplied subset of tblproperties, but the streaming-table alter path renders the changeset as a full CREATE OR REFRESH STREAMING TABLE clause, dropping already-applied desired properties. Return the complete desired config when any property differs, per the DatabricksComponentConfig.get_diff contract.

Add unit regressions (get_diff contract + ST changeset boundary) and make the ST alter functional test additive: assert an already-applied property survives alongside a newly added one.
@sd-db
sd-db merged commit 58ff338 into databricks:main Jun 23, 2026
9 checks passed
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.

running materialized_view always results in a full rebuild

3 participants