fix: suppress use_managed_iceberg warning for non-Iceberg projects#1429
Open
tejassp-db wants to merge 8 commits intomainfrom
Open
fix: suppress use_managed_iceberg warning for non-Iceberg projects#1429tejassp-db wants to merge 8 commits intomainfrom
tejassp-db wants to merge 8 commits intomainfrom
Conversation
…1266) dbt-core's BehaviorFlag machinery emits a deprecation warning the first time a flag with default=False is read. As a result, every dbt run even on Delta-only projects with zero Iceberg models logged a confusing use_managed_iceberg warning. Two-part fix that suppresses the warning everywhere except where it is actionable: - Python: add a `get_behavior_flag_no_warn` helper that reads the flag via the `.no_warn` property (which bypasses the BehaviorChangeEvent), and route all internal accesses of `use_managed_iceberg` through it. - Jinja: in `file_format.sql`, evaluate `table_format == 'iceberg'` before `adapter.behavior.use_managed_iceberg` so non-Iceberg models short-circuit before reading the flag. Resulting matrix: No Iceberg models → no warning (Jinja short-circuits) Iceberg + flag false/unset → warning (the only actionable case) Iceberg + flag true → no warning (dbt-core does not fire it) Tests: - Fix 5 stale tests that overwrote the rendered flag with a raw bool by switching to `.setting = bool`, so the helper can still read `.no_warn`. - Add a `TestFileFormatClause` exploding-property regression test that fails immediately if the macro reads the flag for a non-Iceberg relation. - Add `test_is_uniform_does_not_fire_managed_iceberg_event`, mirroring the existing microbatch event-capture pattern.
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
sd-db
requested changes
Apr 28, 2026
sd-db
approved these changes
Apr 29, 2026
Collaborator
sd-db
left a comment
There was a problem hiding this comment.
Changes look good, have triggered integration tests.
Collaborator
|
/integration-test |
|
Integration tests dispatched for PR #1429 by @sd-db. Track progress in the Actions tab. |
|
Integration results for PR #1429 — UC cluster ❌ failure · SQL warehouse ✅ success · All-purpose cluster ❌ failure |
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.
Summary
Fixes #1266.
dbt-core's
BehaviorFlagemits a deprecation warning the first time a flag withdefault=Falseis read. As a result, every dbt run — even on Delta-only projects with zero Iceberg models — logged a confusinguse_managed_icebergwarning, with no clean way to silence it short of opting in to the flag itself.This PR fixes this by accessing the flag with
non_warnin the code paths. Also flipped the order of comparison in the jinja macro, now warning fires only if its a iceberg model anduse_managed_icerbergis set tofalse.PECOBLR-2638