kacpermuda commented on code in PR #69874:
URL: https://github.com/apache/airflow/pull/69874#discussion_r3587010396
##########
airflow-core/src/airflow/api_fastapi/core_api/services/public/dag_run.py:
##########
@@ -204,7 +211,13 @@ def patch_dag_run_state(
# Not notifying on queued - only notifying on RUNNING, which happens
in the scheduler.
set_dag_run_state_to_queued(dag=dag, run_id=dag_run.run_id,
commit=True, session=session)
elif state == DagRunMutableStates.FAILED:
- set_dag_run_state_to_failed(dag=dag, run_id=dag_run.run_id,
commit=True, session=session)
+ _, running_tis = set_dag_run_state_to_failed(
+ dag=dag, run_id=dag_run.run_id, commit=True, session=session
+ )
+ try:
+ _emit_state_listener_hooks(running_tis, TaskInstanceState.FAILED)
Review Comment:
Correct, I missed that. Thanks !
##########
airflow-core/src/airflow/api_fastapi/core_api/services/public/dag_run.py:
##########
@@ -193,7 +194,13 @@ def patch_dag_run_state(
) -> None:
"""Set a Dag Run's state (success/queued/failed), firing the matching
listener hooks."""
if state == DagRunMutableStates.SUCCESS:
- set_dag_run_state_to_success(dag=dag, run_id=dag_run.run_id,
commit=True, session=session)
+ _, running_tis = set_dag_run_state_to_success(
+ dag=dag, run_id=dag_run.run_id, commit=True, session=session
+ )
+ try:
+ _emit_state_listener_hooks(running_tis, TaskInstanceState.SUCCESS)
+ except Exception:
+ log.exception("error calling listener")
Review Comment:
Correct, I missed that. Thanks !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]