-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
mutually exclusive handling for warn_error_options and warn_error params in Click CLI #6771
mutually exclusive handling for warn_error_options and warn_error params in Click CLI #6771
Conversation
Ensure no elements from group are simultaneously provided by a user, as inferred from params_assigned_from_default. | ||
Raises click.UsageError if any two elements from group are simultaneously provided by a user. | ||
""" | ||
set_flag = None |
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.
effectively a copy from main flags.py: https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/flags.py#L196
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. |
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.
Mostly LGTM, left some comments around making the code more Pythonic.
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.
Discussed comments offline, LGTM!
Flags(context, user_config) | ||
|
||
@pytest.mark.parametrize("warn_error", ["True", "False"]) | ||
def test_mutually_exclusive_options_from_cli_and_envvar(self, warn_error, monkeypatch): |
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 probably didn't have to have tests for some of these combos given that Click resolves the cli params and the env var params before we get to this stage in the code-- but I'll never complain about having more tests.
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.
LGTM!
…ams in Click CLI (#6771) warn_error_options, warn_error mutual exclusivity with click
…ams in Click CLI (#6771) warn_error_options, warn_error mutual exclusivity with click
resolves #6579
Description
Checklist
🎩
(warn_error_options set by user config, warn_error by CLI params)
(both options set from CLI params)
changie new
to create a changelog entry