Repository navigation
fix: Avoid injected settings to reach manifest and overselect on state:modified - #677
29antonioac wants to merge 7 commits into
Conversation
|
Ey @29antonioac , thanks as always for reporting it and for sharing a PR 🙇 I was wondering that the solution feels like should go in the other direction: Instead of skipping it, any setting the adapter add should be recorded in the manifest in both situations. Out of curiosity, have you checked it we can do it otherwise? Maybe we need to change when this setting is added to make sure it's always included |
|
Hey mate, no problem! Happy to support OSS 😄 Please take my opinion with a pinch of salt: I'm not a dbt expert or power user, just a guy trying to help his colleagues, I feel more comfortable with ClickHouse than dbt in general, so I can be missing details 😄 . I was wondering the same, maybe the manifest should get all settings of the model, including the injected ones. However, when finding the issue because of The setting only applies to MergeTree tables, not sure if I'm happy to look for a way to get the manifest with whatever setting the adapter injects at |
Agree 100% that it wouldn't be nice at all, but after giving a second thought, maybe it's worth it to flag them 🤔. If some config change, like Would you check if there's indeed a way to do that? Btw, I thought version checking may get in the middle of it, so assume in your checks that the version checking is removed. I already removed that code here https://github.com/ClickHouse/dbt-clickhouse/pull/678/changes |
…als and manifest are available without a connection
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit bb857a2. Configure here.
|
@koletzilla It's not the nicest solution, but with Claude and inspecting dbt core it seems there is a point where the manifest is resolved at parse time and we can inject settings there instead: It feels a bit hacky though. Also the solution in the new test to read explicitly the manifest without I removed the version comparison too as you mentioned 😄 |

Summary
Fixes a bug where
get_model_settingsmutatedmodel['config']['settings']in-place, causing adapter-injected settings (e.g.replicated_deduplication_window='0') to be persisted intomanifest.jsonafterdbt run. This produced a permanent asymmetry with manifests generated bydbt parseordbt ls, which never callget_model_settingsand therefore produced a clean manifest. The mismatch caused--select state:modified+ --deferto reportconfig_changedon every affected model on every subsequent run, even when nothing had changed.Fix: deep-copy the settings dict in
get_model_settingsbefore passing it toupdate_model_settings, so the originalmodel['config']is never touched.Related to #372.
Closes #676
Checklist
Note
Medium Risk
Changes when and how model config is written into the manifest, which affects deferred runs and state comparison; scope is limited to settings injection with new integration coverage.
Overview
Fixes false
state:modified/config_changedhits on--deferwhen adapter-injected ClickHouse settings (e.g.replicated_deduplication_window='0') appeared only afterdbt runbecauseget_model_settingsmutatedmodel['config']['settings']via the DB client.Adapter defaults are now applied once at parse time through
set_macro_resolverandget_injected_model_settings, so parse and run manifests carry the same settings;get_model_settingsonly reads config and no longer callsupdate_model_settings. Per-connection_model_settingsinjection indbclientis removed. Integration tests assert parse/run manifest agreement and that a second deferred run selects no models when nothing changed.Reviewed by Cursor Bugbot for commit 513cec4. Bugbot is set up for automated code reviews on this repo. Configure here.