Skip to content
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

Fix --config-dir flag's implicit string conversion problems #7793

Merged
merged 2 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20230621-030733.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Fix a bad implicit string conversion regression in debug --config-dir code.
time: 2023-06-21T03:07:33.815966-07:00
custom:
Author: versusfacit
Issue: "7774"
2 changes: 1 addition & 1 deletion core/dbt/cli/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
config_dir = click.option(
"--config-dir",
envvar=None,
help="Show the configured location for the profiles.yml file and exit",
help="Print a system-specific command to access the directory that the current dbt project is searching for a profiles.yml. Then, exit. This flag renders other debug step flags no-ops.",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disambiguated flag.

is_flag=True,
)

Expand Down
11 changes: 6 additions & 5 deletions core/dbt/task/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ def project_profile(self):
return None
return self.project.profile_name

def path_info(self):
open_cmd = dbt.clients.system.open_dir_cmd()
fire_event(OpenCommand(open_cmd=open_cmd, profiles_dir=self.profiles_dir))

def run(self) -> bool:
# WARN: this is a legacy workflow that is not compatible with other runtime flags
Copy link
Contributor Author

@VersusFacit VersusFacit Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flattened the code -- also it's fixed -- and commented it for the next person who is confused with what the intended semantics are here.

if self.args.config_dir:
self.path_info()
fire_event(
OpenCommand(
open_cmd=dbt.clients.system.open_dir_cmd(), profiles_dir=str(self.profiles_dir)
)
)
return DebugRunStatus.SUCCESS.value

version: str = get_installed_version().to_version_string(skip_matcher=True)
Expand Down