feat: warn on unknown flags in dbt_project.yml#12689
Conversation
|
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12689 +/- ##
==========================================
- Coverage 91.41% 88.14% -3.27%
==========================================
Files 203 203
Lines 25883 25890 +7
==========================================
- Hits 23662 22822 -840
- Misses 2221 3068 +847
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Hi @chinar-amrutkar . We require all commits to be signed and the first commit in this PR isn't signed. There are also some failures from Can you take care of it so that I can take this PR forward? |
sriramr98
left a comment
There was a problem hiding this comment.
There are still two commits which aren't verified. Can you fix them?
5fce0de to
f86a183
Compare
|
@sriramr98 I have updated the commits and they are now verified. I have implemented the other requested changes as well. |
|
@MichelleArk could you kindly review when you have a moment? Thank you! |
|
@chinar-amrutkar It looks like some relevant unit tests are failing. Can you take a look at them?
|
Add validation to warn users when they set flags in dbt_project.yml that dbt doesn't recognize. This helps prevent conflicts with future dbt flags and makes it clearer what's 'official' vs custom. When unknown flags are detected, fires an InvalidOptionYAML event listing the unknown flags and a sample of valid ones. Closes dbt-labs#12590
…elog, add unit test
…ture - Move InvalidOptionYAML and fire_event imports to top of project.py - Move InvalidOptionYAML and read_project_flags imports to top of test_project.py - Fix changelog YAML: Issue should be child of custom, not top-level issues list
f86a183 to
6c4cc2e
Compare
|
@sriramr98 could you kindly approve the CI workflow so that I can check the tests? |
|
Hey @chinar-amrutkar . Apologies for the delay. The unit tests are still failing. For future ref - You don't have to wait for a contributor to approve running the tests. You can run I also don't see signed commits in this PR. The commits should be signed for us to merge this PR once everything checks out. |
|
Closing this PR due to inactivity. Same changes with minor modifications in this PR Thanks for the initial work @chinar-amrutkar |
Closes #12590
Problem
When users set flags in
dbt_project.ymlthat dbt doesn't recognize (e.g., typos likeprrintinstead ofprint), dbt silently ignores them. There's no feedback to the user that their configuration is being ignored, leading to confusion when expected behavior doesn't change.Solution
Added validation in
read_project_flags()atcore/dbt/config/project.pythat compares the user's flags against knownProjectFlagsfield names. Unknown flags trigger a warning viafire_event(InvalidOptionYAML(...)), guiding users to fix their config.The warning message lists the first 10 known flag names to help users identify the correct option.
Checklist