diff --git a/cosmos/providers/dbt/core/operators/local.py b/cosmos/providers/dbt/core/operators/local.py index 2efba7e94..45d9fcfb0 100644 --- a/cosmos/providers/dbt/core/operators/local.py +++ b/cosmos/providers/dbt/core/operators/local.py @@ -201,7 +201,7 @@ def run_command( logger.info("Trying to run the command:\n %s\nFrom %s", cmd, tmp_project_dir) result = self.run_subprocess( - command=cmd, + command=cmd + ["--profile", profile_name], env=env, output_encoding=self.output_encoding, cwd=tmp_project_dir, diff --git a/cosmos/providers/dbt/dag.py b/cosmos/providers/dbt/dag.py index 209b009e7..405dee338 100644 --- a/cosmos/providers/dbt/dag.py +++ b/cosmos/providers/dbt/dag.py @@ -1,6 +1,8 @@ """ This module contains a function to render a dbt project as an Airflow DAG. """ +from __future__ import annotations + try: from typing import Literal except ImportError: diff --git a/cosmos/providers/dbt/render.py b/cosmos/providers/dbt/render.py index a7cd572e0..67755d6d5 100644 --- a/cosmos/providers/dbt/render.py +++ b/cosmos/providers/dbt/render.py @@ -1,6 +1,8 @@ """ This module contains a function to render a dbt project into Cosmos entities. """ +from __future__ import annotations + import itertools import logging diff --git a/cosmos/providers/dbt/task_group.py b/cosmos/providers/dbt/task_group.py index e4e99ce98..eb3a5e066 100644 --- a/cosmos/providers/dbt/task_group.py +++ b/cosmos/providers/dbt/task_group.py @@ -1,6 +1,8 @@ """ This module contains a function to render a dbt project as an Airflow Task Group. """ +from __future__ import annotations + try: from typing import Literal except ImportError: diff --git a/dev/dags/basic_cosmos_dag.py b/dev/dags/basic_cosmos_dag.py index 42b3f85ab..93bb45e04 100644 --- a/dev/dags/basic_cosmos_dag.py +++ b/dev/dags/basic_cosmos_dag.py @@ -20,6 +20,7 @@ profile_args={ "schema": "public", }, + profile_name_override="airflow", # normal dag parameters schedule_interval="@daily", start_date=datetime(2023, 1, 1),