diff --git a/cosmos/listeners/dag_run_listener.py b/cosmos/listeners/dag_run_listener.py index 1712e4250..2b0b60698 100644 --- a/cosmos/listeners/dag_run_listener.py +++ b/cosmos/listeners/dag_run_listener.py @@ -47,8 +47,12 @@ def uses_cosmos(dag: DAG) -> bool: return bool(is_cosmos_dag(dag) or total_cosmos_task_groups(dag) or total_cosmos_tasks(dag)) +from airflow.utils.session import provide_session + + +@provide_session @hookimpl -def on_dag_run_success(dag_run: DagRun, msg: str) -> None: +def on_dag_run_success(dag_run: DagRun, msg: str, session=None) -> None: logger.info(f"dir: {dir(dag_run.dag)}") logger.info("The on_dag_run_success was called")