You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/09/27 07:14:03 UTC
[GitHub] [airflow] uranusjr commented on a diff in pull request #34642: Run triggers inline with dag test
uranusjr commented on code in PR #34642:
URL: https://github.com/apache/airflow/pull/34642#discussion_r1338147901
##########
airflow/models/dag.py:
##########
@@ -3967,18 +3980,33 @@ def _run_task(ti: TaskInstance, session):
Args:
ti: TaskInstance to run
"""
+ ret = None
log.info("*****************************************************")
if ti.map_index > 0:
log.info("Running task %s index %d", ti.task_id, ti.map_index)
else:
log.info("Running task %s", ti.task_id)
try:
- ti._run_raw_task(session=session)
+ while True:
+ try:
+ ret = ti._run_raw_task(session=session, raise_on_defer=True)
+ break
+ except TaskDeferred as e:
Review Comment:
I wonder if we should add an argument to `_run_raw_task` so it skips all the leg work (mostly in `_defer_task` but also adding a Log). If we avoid `_defer_task` altogether, this block would not intefere with a real triggerer because the triggerer will never see the ti (being never in the DEFERRED state).
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org