Skip to content

Commit

Permalink
Fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajastro committed Feb 12, 2025
1 parent a58d37b commit af2a876
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cosmos/airflow/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from cosmos.core.graph.entities import Task as TaskMetadata
from cosmos.dbt.graph import DbtNode
from cosmos.log import get_logger
from cosmos.settings import enable_setup_async_task, enable_teardown_task
from cosmos.settings import enable_setup_async_task, enable_teardown_async_task

logger = get_logger(__name__)

Expand Down Expand Up @@ -627,7 +627,7 @@ def build_airflow_graph(
create_airflow_task_dependencies(nodes, tasks_map)
if enable_setup_async_task:
_add_dbt_setup_async_task(dag, execution_mode, task_args, tasks_map, task_group, render_config=render_config)
if enable_teardown_task:
if enable_teardown_async_task:
_add_teardown_task(dag, execution_mode, task_args, tasks_map, task_group, render_config=render_config)
return tasks_map

Expand Down
4 changes: 2 additions & 2 deletions cosmos/operators/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from cosmos.exceptions import AirflowCompatibilityError, CosmosDbtRunError, CosmosValueError
from cosmos.settings import (
enable_setup_async_task,
enable_teardown_task,
enable_teardown_async_task,
remote_target_path,
remote_target_path_conn_id,
)
Expand Down Expand Up @@ -477,7 +477,7 @@ def _handle_post_execution(self, tmp_project_dir: str, context: Context) -> None
self.callback(tmp_project_dir, **self.callback_args)

def _handle_async_execution(self, tmp_project_dir: str, context: Context, async_context: dict[str, Any]) -> None:
if async_context.get("teardown_task") and enable_teardown_task:
if async_context.get("teardown_task") and enable_teardown_async_task:
self._delete_sql_files(Path(tmp_project_dir), "run")
return

Check warning on line 482 in cosmos/operators/local.py

View check run for this annotation

Codecov / codecov/patch

cosmos/operators/local.py#L481-L482

Added lines #L481 - L482 were not covered by tests

Expand Down
2 changes: 1 addition & 1 deletion cosmos/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

# Related to async operators
enable_setup_async_task = conf.getboolean("cosmos", "enable_setup_async_task", fallback=True)
enable_teardown_task = conf.getboolean("cosmos", "", fallback=True)
enable_teardown_async_task = conf.getboolean("cosmos", "enable_teardown_async_task", fallback=True)

AIRFLOW_IO_AVAILABLE = Version(airflow_version) >= Version("2.8.0")

Expand Down

0 comments on commit af2a876

Please sign in to comment.