uranusjr commented on a change in pull request #16768:
URL: https://github.com/apache/airflow/pull/16768#discussion_r664998123
##########
File path: airflow/dag_processing/processor.py
##########
@@ -568,14 +568,11 @@ def _execute_task_callbacks(self, dagbag: DagBag,
request: TaskCallbackRequest):
dag = dagbag.dags[simple_ti.dag_id]
if simple_ti.task_id in dag.task_ids:
task = dag.get_task(simple_ti.task_id)
- ti = TI(task, simple_ti.execution_date)
- # Get properties needed for failure handling from
SimpleTaskInstance.
- ti.start_date = simple_ti.start_date
- ti.end_date = simple_ti.end_date
- ti.try_number = simple_ti.try_number
- ti.state = simple_ti.state
- ti.test_mode = self.UNIT_TEST_MODE
if request.is_failure_callback:
+ ti = TI(task, simple_ti.execution_date)
+ #TODO use simple_ti to improve performance here in the
future
+ ti.refresh_from_db()
+ ti.test_mode = self.UNIT_TEST_MODE
Review comment:
`handle_failure_with_callback` has an explicit `test_mode` argument, you
can use that instead of hacking the value on like this
--
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]