From 403de09407fbac06014b583af22fc28cef071bcc Mon Sep 17 00:00:00 2001 From: tnk-ysk Date: Sun, 9 Feb 2025 23:56:42 +0900 Subject: [PATCH 1/2] Fix default_profiles_dir --- core/dbt/cli/resolvers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/dbt/cli/resolvers.py b/core/dbt/cli/resolvers.py index 48ba92c365a..ece565c042c 100644 --- a/core/dbt/cli/resolvers.py +++ b/core/dbt/cli/resolvers.py @@ -10,7 +10,8 @@ def default_project_dir() -> Path: def default_profiles_dir() -> Path: - return Path.cwd() if (Path.cwd() / "profiles.yml").exists() else Path.home() / ".dbt" + paths = [Path.cwd(), Path.home() / ".dbt"] + return next((x for x in paths if (x / "profiles.yml").exists()), Path.cwd()) def default_log_path(project_dir: Path, verify_version: bool = False) -> Path: From 3d7df3bd9ab9f15f2d0f0bdee007e87a3e89cad2 Mon Sep 17 00:00:00 2001 From: tnk-ysk Date: Mon, 10 Feb 2025 00:04:02 +0900 Subject: [PATCH 2/2] Add changelog --- .changes/unreleased/Fixes-20250210-000107.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Fixes-20250210-000107.yaml diff --git a/.changes/unreleased/Fixes-20250210-000107.yaml b/.changes/unreleased/Fixes-20250210-000107.yaml new file mode 100644 index 00000000000..c8390871ab9 --- /dev/null +++ b/.changes/unreleased/Fixes-20250210-000107.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Error occurs if default_profiles_dir does not exist +time: 2025-02-10T00:01:07.477255+09:00 +custom: + Author: tnk-ysk + Issue: "11286"