From 430aec3ee14c5364d416f97da53bf248d836c787 Mon Sep 17 00:00:00 2001 From: Tatiana Al-Chueyr Date: Fri, 20 Dec 2024 06:37:47 +0000 Subject: [PATCH] Force to fetch the actual dag, add more debug logs --- cosmos/listeners/dag_run_listener.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cosmos/listeners/dag_run_listener.py b/cosmos/listeners/dag_run_listener.py index b382b8210..e21897687 100644 --- a/cosmos/listeners/dag_run_listener.py +++ b/cosmos/listeners/dag_run_listener.py @@ -61,14 +61,13 @@ def on_dag_run_success(dag_run: DagRun, msg: str) -> None: logger.info(f"3: {serialized_dag.task_dict}") logger.info(f"4: {serialized_dag.task_group_dict}") - if not isinstance(serialized_dag, DAG): - from airflow.models import DagBag + from airflow.models import DagBag - logger.info("The DAG does not use Cosmos") - dag_bag = DagBag(dag_folder=dag.fileloc, include_examples=False) - dag = dag_bag.get_dag(dag_run.dag_id) + dag_bag = DagBag(dag_folder=dag.fileloc, include_examples=False) + dag = dag_bag.get_dag(dag_run.dag_id) if not uses_cosmos(dag): + logger.info("The DAG does not use Cosmos") logger.info(f"5: {serialized_dag.deserialize()}") return