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 7661ab3 commit 7ae6152
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cosmos/listeners/dag_run_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,24 @@ 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()

logger.info(f"dir: {dir(dag)}")
logger.info(f"1: {dag.fileloc}")
logger.info(f"2:{dag.filepath}")
logger.info(f"3: {dag.task_dict}")
logger.info(f"4: {dag.task_group_dict}")
logger.info(f"5: {dag.serialize_to_json()}")
logger.info(f"6: {dag.deserialize_dag()}")
logger.info(f"5: {dag.get_serialized_fields()}")
logger.info(f"6: {dag.to_dict()}")
logger.info(f"7: {dag.deserialize()}")

if not isinstance(dag, DAG):
from airflow.models import DagBag

if not uses_cosmos(dag):
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)

if not uses_cosmos(dag):
return

additional_telemetry_metrics = {
Expand Down

0 comments on commit 7ae6152

Please sign in to comment.