Skip to content

Commit

Permalink
Add invocation command flag (#7939)
Browse files Browse the repository at this point in the history
* Add invocation command flag

* Add changie entry

* Update .changes/unreleased/Features-20230623-111254.yaml
  • Loading branch information
NiallRees authored Jun 28, 2023
1 parent b3ac41f commit 22145e7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20230623-111254.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Add invocation_command to flags
time: 2023-06-23T11:12:54.523157-07:00
custom:
Author: NiallRees
Issue: "6051"
3 changes: 3 additions & 0 deletions core/dbt/cli/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ def _assign_params(
profiles_dir = getattr(self, "PROFILES_DIR", None)
user_config = read_user_config(profiles_dir) if profiles_dir else None

# Add entire invocation command to flags
object.__setattr__(self, "INVOCATION_COMMAND", "dbt " + " ".join(sys.argv[1:]))

# Overwrite default assignments with user config if available.
if user_config:
param_assigned_from_default_copy = params_assigned_from_default.copy()
Expand Down
1 change: 1 addition & 0 deletions core/dbt/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def get_flag_dict():
"introspect",
"target_path",
"log_path",
"invocation_command",
}
return {key: getattr(GLOBAL_FLAGS, key.upper(), None) for key in flag_attr}

Expand Down

0 comments on commit 22145e7

Please sign in to comment.