-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move UserConfig to dbt_project.yml and rename to ProjectFlags #9289
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 ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #9289 +/- ##
==========================================
- Coverage 86.61% 86.59% -0.02%
==========================================
Files 221 221
Lines 26969 26997 +28
==========================================
+ Hits 23360 23379 +19
- Misses 3609 3618 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
dbt_project.yml
a default of None
@@ -709,7 +715,6 @@ def to_project_config(self, with_packages=False): | |||
"exposures": self.exposures, | |||
"vars": self.vars.to_dict(), | |||
"require-dbt-version": [v.to_version_string() for v in self.dbt_version], | |||
"config-version": self.config_version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this just removing some dead code? or are we actively removing support for config-version in dbt_project.yml with this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We removed support for config-version sometime last year, but a few things were still hanging around. It still exists in the class that validates because we don't want to cause a validation error, but there's no point in passing it along.
core/dbt/common/events/types.proto
Outdated
// E - DB Adapter | ||
|
||
// E001 | ||
message AdapterEventDebug { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why move adapter events into common?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't. Don't know why that's showing up as a change. I just merged main into the branch... Git might have gotten confused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there was a merge error which needed to be resolved but wasn't, and nothing failed because types.proto wasn't rebuilt...
@@ -404,3 +406,38 @@ def test_from_dict_0_value(self): | |||
args_dict = {"log_file_max_bytes": 0} | |||
flags = Flags.from_dict(Command.RUN, args_dict) | |||
assert flags.LOG_FILE_MAX_BYTES == 0 | |||
|
|||
|
|||
def test_project_flag_defaults(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Opened a new issue in dbt-labs/docs.getdbt.com: dbt-labs/docs.getdbt.com#4709 |
resolves #9183
Problem
The flags that are in the current UserConfig object attached to the profile should be in dbt_project.yml.
Solution
Rename UserConfig to ProjectFlags, and various variables and attributes from "user_config" to "project_flags". Modify function called in core/dbt/cli/flags.py to retrieve flags to look in both profiles.yml and dbt_project.yml, and issue a deprecation warning if found in profiles.yml and raise an error if found in both places.
Note that we can't use the warn_errors and warn_error_options for this deprecation warning because the deprecation is encountered when loading the project flags which contains warn_errors and warn_error_options.
Remove skipped and unnecessary tests/unit/test_flags.py file.
Checklist