Skip to content

Commit

Permalink
Add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tatiana committed Dec 20, 2024
1 parent fc7b502 commit a1d63ee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cosmos/listeners/dag_run_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class EventStatus:


def is_cosmos_dag(dag: DAG) -> bool:
logger.info("is_cosmos_dag: {dag.__class__.__module__}")
if dag.__class__.__module__.startswith("cosmos."):
return True
return False
Expand All @@ -27,6 +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("total_cosmos_task_groups: {task_group.__class__}")
if task_group.__class__.__module__.startswith("cosmos."):
cosmos_task_groups += 1
return cosmos_task_groups
Expand All @@ -35,9 +37,8 @@ def total_cosmos_task_groups(dag: DAG) -> int:
def total_cosmos_tasks(dag: DAG) -> int:
cosmos_tasks = 0
for task in dag.tasks:
task_class = type(task)
task_module = task_class.__module__
if task_module.startswith("cosmos."):
logger.info("total_cosmos_task_groups: {task.__class__.__module__}")
if task.__class__.__module__.startswith("cosmos."):
cosmos_tasks += 1
return cosmos_tasks

Expand Down

0 comments on commit a1d63ee

Please sign in to comment.