From 193b9289b9d85fdfd555684a9b857a798dbbed05 Mon Sep 17 00:00:00 2001 From: lmiranda Date: Sun, 18 Jan 2026 12:06:58 -0500 Subject: [PATCH] fix: Configure dbt to use local profiles.yml - Rename profiles.yml.example to profiles.yml (uses env vars, safe to commit) - Add --profiles-dir flag to dbt commands in load_toronto_data.py - Add --profiles-dir flag to dbt targets in Makefile This fixes the "Path '~/.dbt' does not exist" error when running make load-data. Co-Authored-By: Claude Opus 4.5 --- Makefile | 6 +++--- dbt/{profiles.yml.example => profiles.yml} | 0 scripts/data/load_toronto_data.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename dbt/{profiles.yml.example => profiles.yml} (100%) diff --git a/Makefile b/Makefile index b18b581..96ce1c9 100644 --- a/Makefile +++ b/Makefile @@ -113,15 +113,15 @@ test-cov: ## Run pytest with coverage dbt-run: ## Run dbt models @echo "$(GREEN)Running dbt models...$(NC)" - cd dbt && dbt run + cd dbt && dbt run --profiles-dir . dbt-test: ## Run dbt tests @echo "$(GREEN)Running dbt tests...$(NC)" - cd dbt && dbt test + cd dbt && dbt test --profiles-dir . dbt-docs: ## Generate dbt documentation @echo "$(GREEN)Generating dbt docs...$(NC)" - cd dbt && dbt docs generate && dbt docs serve + cd dbt && dbt docs generate --profiles-dir . && dbt docs serve --profiles-dir . # ============================================================================= # Code Quality diff --git a/dbt/profiles.yml.example b/dbt/profiles.yml similarity index 100% rename from dbt/profiles.yml.example rename to dbt/profiles.yml diff --git a/scripts/data/load_toronto_data.py b/scripts/data/load_toronto_data.py index 03a22bc..3787571 100644 --- a/scripts/data/load_toronto_data.py +++ b/scripts/data/load_toronto_data.py @@ -297,7 +297,7 @@ class DataPipeline: # Run dbt models logger.info(" Running dbt run...") result = subprocess.run( - ["dbt", "run"], + ["dbt", "run", "--profiles-dir", str(dbt_project_dir)], cwd=dbt_project_dir, capture_output=True, text=True, @@ -314,7 +314,7 @@ class DataPipeline: # Run dbt tests logger.info(" Running dbt test...") result = subprocess.run( - ["dbt", "test"], + ["dbt", "test", "--profiles-dir", str(dbt_project_dir)], cwd=dbt_project_dir, capture_output=True, text=True,