You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now in the click cli, we are trying to front load everything in Flags and then trying to use it at the root level CLI function. This makes accessing attributes defined in lower level cli functions possible, but this operation itself is not safe.
For example, right now if we try to run docs command with the click cli(python core/dbt/cli/main.py docs), we will run into error
File "/Users/chenyuli/git/dbt-core/core/dbt/cli/main.py", line 70, in cli
initialize_from_flags(flags.ANONYMOUS_USAGE_STATS, flags.PROFILES_DIR)
AttributeError: 'Flags' object has no attribute 'PROFILES_DIR'
since PROFILES_DIR is a parameter that is not defined in any of the command under docs, it never got set in Flags.
potential Exit Criteria:
Rethink about whether construct flags at root level cli and do everything there is the method we want to go next
If answer to 1 is yes, then come up with solutions of making accessing potential non-existence attributes raise warning if there are cases that is not thought through(maybe through auto generated tests?). If the answer to 1 is no, then come up with new way to organize parameters and test that properly.
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
A general solution for accessing attributes in the flag object safely
[CT-1511] A general solution for accessing attributes in the flag object safely
Nov 16, 2022
Issue
Right now in the click cli, we are trying to front load everything in Flags and then trying to use it at the root level CLI function. This makes accessing attributes defined in lower level cli functions possible, but this operation itself is not safe.
For example, right now if we try to run
docs
command with the click cli(python core/dbt/cli/main.py docs
), we will run into errorsince
PROFILES_DIR
is a parameter that is not defined in any of the command underdocs
, it never got set inFlags
.potential Exit Criteria:
The text was updated successfully, but these errors were encountered: