diff --git a/cosmos/listeners/dag_run_listener.py b/cosmos/listeners/dag_run_listener.py index e10ff1305..a270057f9 100644 --- a/cosmos/listeners/dag_run_listener.py +++ b/cosmos/listeners/dag_run_listener.py @@ -19,7 +19,7 @@ class EventStatus: def is_cosmos_dag(dag: DAG) -> bool: - logger.info(f"is_cosmos_dag: {dag.__class__.__module__}") + logger.info(f"is_cosmos_dag: {dag.__class__}") if dag.__class__.__module__.startswith("cosmos."): return True return False @@ -28,7 +28,7 @@ def is_cosmos_dag(dag: DAG) -> bool: def total_cosmos_task_groups(dag: DAG) -> int: cosmos_task_groups = 0 for group_id, task_group in dag.task_group_dict.items(): - logger.info(f"total_cosmos_task_groups: {task_group.__class__.__module__}") + logger.info(f"total_cosmos_task_groups: {task_group.__class__}") if task_group.__class__.__module__.startswith("cosmos."): cosmos_task_groups += 1 return cosmos_task_groups @@ -37,7 +37,7 @@ def total_cosmos_task_groups(dag: DAG) -> int: def total_cosmos_tasks(dag: DAG) -> int: cosmos_tasks = 0 for task in dag.tasks: - logger.info(f"total_cosmos_task_groups: {task.__class__.__module__}") + logger.info(f"total_cosmos_task_groups: {task.__class__}") if task.__class__.__module__.startswith("cosmos."): cosmos_tasks += 1 return cosmos_tasks @@ -52,6 +52,8 @@ def on_dag_run_success(dag_run: DagRun, msg: str) -> None: logger.info("The on_dag_run_success was called") dag = dag_run.get_dag() + dag_run.dag_id + if not uses_cosmos(dag): logger.info("The DAG does not use Cosmos") return