uranusjr commented on code in PR #59604:
URL: https://github.com/apache/airflow/pull/59604#discussion_r2667654783


##########
airflow-core/src/airflow/models/dagrun.py:
##########
@@ -1556,7 +1574,14 @@ def _expand_mapped_task_if_needed(ti: TI) -> 
Iterable[TI] | None:
             if TYPE_CHECKING:
                 assert isinstance(schedulable.task, Operator)
             old_state = schedulable.state
-            if not schedulable.are_dependencies_met(session=session, 
dep_context=dep_context):
+            if not schedulable.are_dependencies_met(
+                session=session,
+                dep_context=(
+                    dep_context
+                    if old_state != TaskInstanceState.UP_FOR_RESCHEDULE
+                    else dep_context_with_reschedule

Review Comment:
   I wonder if this conditional logic can be built into `are_dependencies_met` 
since that function knows the old state.
   
   We can have a dep class similar to `ReadyToRescheduleDep` to contain this 
logic. The dep class knows about the ti when it evaluates and can handle 
`ti.state` in `_get_dep_statuses`.



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