Skip to content

fix: missing metadata handling in is_hudi and is_iceberg - #1435

Merged
sd-db merged 2 commits into
databricks:mainfrom
aarushisingh04:fix-relation-metadata-assert
May 2, 2026
Merged

fix: missing metadata handling in is_hudi and is_iceberg#1435
sd-db merged 2 commits into
databricks:mainfrom
aarushisingh04:fix-relation-metadata-assert

Conversation

@aarushisingh04

Copy link
Copy Markdown
Contributor

description

can_be_replaced calls is_iceberg without first checking whether metadata is available. on relations that haven't fetched extended metadata yet (metadata=None) this hits an unconditional assert self.metadata is not None and crashes the dbt run with an AssertionError.

the fix

  • updates is_hudi and is_iceberg to safely return False when self.metadata is None, making their behavior consistent with other metadata properties like owner and stats.
  • unit tests have also been added to ensure properties evaluate gracefully on un-hydrated relations.

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.

@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.

Changes look good, thanks for the PR!

@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  dbt/adapters/databricks
  relation.py
Project Total  

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

@sd-db
sd-db merged commit 13a3942 into databricks:main May 2, 2026
7 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.

2 participants