Skip to content

Commit

Permalink
Force to fetch the actual dag, add more debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tatiana committed Dec 20, 2024
1 parent 5caf6a8 commit 430aec3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cosmos/listeners/dag_run_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 430aec3

Please sign in to comment.