fix: Use explicit path for .env file loading

load_dotenv() was searching from cwd, which may not be the project root.
Now explicitly passes PROJECT_ROOT / ".env" path.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-18 12:14:48 -05:00
parent 9a1fc81f79
commit 6872aa510b

View File

@@ -30,11 +30,11 @@ from typing import Any
from dotenv import load_dotenv
# Load .env file so dbt can access POSTGRES_* environment variables
load_dotenv()
# Add project root to path
PROJECT_ROOT = Path(__file__).parent.parent.parent
# Load .env file so dbt can access POSTGRES_* environment variables
load_dotenv(PROJECT_ROOT / ".env")
sys.path.insert(0, str(PROJECT_ROOT))
from portfolio_app.toronto.loaders import ( # noqa: E402