From f1bebb3629699876397aa7c454708dbc68458e27 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Thu, 2 Dec 2021 17:35:51 +0100 Subject: [PATCH] Tiny touchups for deps, clean (#4366) (#4387) * Use actual profile name for log msg * Raise clean dep warning iff configured path missing --- core/dbt/config/runtime.py | 6 +++++- core/dbt/task/clean.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/dbt/config/runtime.py b/core/dbt/config/runtime.py index 820b966eea8..40f12a1098e 100644 --- a/core/dbt/config/runtime.py +++ b/core/dbt/config/runtime.py @@ -545,8 +545,12 @@ def _get_rendered_profile( args, profile_renderer, profile_name ) except (DbtProjectError, DbtProfileError) as exc: + selected_profile_name = Profile.pick_profile_name( + args_profile_name=getattr(args, 'profile', None), + project_profile_name=profile_name + ) fire_event(ProfileLoadError(exc=exc)) - fire_event(ProfileNotFound(profile_name=profile_name)) + fire_event(ProfileNotFound(profile_name=selected_profile_name)) # return the poisoned form profile = UnsetProfile() # disable anonymous usage statistics diff --git a/core/dbt/task/clean.py b/core/dbt/task/clean.py index 6dfc8b3328b..3bee3459437 100644 --- a/core/dbt/task/clean.py +++ b/core/dbt/task/clean.py @@ -38,7 +38,7 @@ def run(self): """ move_to_nearest_project_dir(self.args) if ('dbt_modules' in self.config.clean_targets and - self.config.packages_install_path != 'dbt_modules'): + self.config.packages_install_path not in self.config.clean_targets): deprecations.warn('install-packages-path') for path in self.config.clean_targets: fire_event(CheckCleanPath(path=path))