xBis7 commented on code in PR #71737:
URL: https://github.com/apache/airflow/pull/71737#discussion_r3864218652


##########
airflow-core/src/airflow/models/dagrun.py:
##########
@@ -1333,7 +1361,7 @@ def recalculate(self) -> _UnfinishedStates:
                 callback = self.produce_dag_callback(
                     dag=dag,
                     success=False,
-                    relevant_ti=ti_causing_failure,
+                    
relevant_ti=self._ensure_type_task_instance(ti_causing_failure, 
session=session),

Review Comment:
   `produce_dag_callback` needs an actual TaskInstance ORM object and 
`_ensure_type_task_instance` is used to check if the passed ti is `FinishedTI` 
or `TaskInstance`. If it's `FinishedTI`, we fetch the info from the DB and then 
hydrate a `TaskInstance` ORM object.
   
   That's why the function is called 'ensure...` because if the type is right, 
it's a no-op, otherwise we do the conversion.
   
   Same for the other call sites.



-- 
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]

Reply via email to