-
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
[CT-2069] Unexpected behavior with global/subcommand flags #6913
Comments
@jtcohen6 Can we choose only the option where there are not parent flags? LIke |
@stu-k That would be a significant breaking change for a large number of existing CLI users, so I don't see it as a viable option. |
@jtcohen6 Would it be fair to ask that a flag be defined in either the parent or child level, not both? ✅ |
It's clear that this is the intent of the Acceptance criteria for this ticket:
|
@ChenyuLInx says: dbt-core/core/dbt/cli/flags.py Line 87 in 7774857
This is the wrong |
@jtcohen6 Just to be clear-- your 👍 on this comment means there is no legitimate use case where the same flag will be populated on multiple levels? I ask because right now we have logic here specifically to support that happening. |
IMO, if the same flag is passed at both the "parent" and the "child" levels:
I understand that standard CLI behavior allows you to pass the same flag multiple times, and the last one wins, e.g. |
For backwards compatibility with older behavior, some flags are implemented at both the "global" ("parent") level, and also at the "subcommand" ("child") level. We have some tricky logic to handle this potential duplication:
dbt-core/core/dbt/cli/flags.py
Lines 70 to 95 in 7774857
On
feature/click-cli
branch, I'm observing behavior where:Expected behavior:
Example
Create a new dbt project, and add
require-dbt-version: "1.4.1"
todbt_project.yml
.The text was updated successfully, but these errors were encountered: