ephraimbuddy commented on issue #27449:
URL: https://github.com/apache/airflow/issues/27449#issuecomment-1302463474

   It looks like non-expanded mapped task instances don't have `upstream_list ` 
i.e `ti.task.upstream_list` is `[]`. I got the test case to work with this:
   
   ```diff
   diff --git a/airflow/ti_deps/deps/trigger_rule_dep.py 
b/airflow/ti_deps/deps/trigger_rule_dep.py
   index 39722c6df3..f50043c7b6 100644
   --- a/airflow/ti_deps/deps/trigger_rule_dep.py
   +++ b/airflow/ti_deps/deps/trigger_rule_dep.py
   @@ -67,6 +67,9 @@ class TriggerRuleDep(BaseTIDep):
        def _get_dep_statuses(self, ti, session, dep_context: DepContext):
            # Checking that all upstream dependencies have succeeded
            if not ti.task.upstream_list:
   +            if ti.task.is_mapped and ti.map_index == -1:
   +                yield self._failing_status(reason="Task is a mapped task 
and has not expanded.")
   +                return
                yield self._passing_status(reason="The task instance did not 
have any upstream tasks.")
                return
   ```
   cc: @uranusjr, would like to hear what you think about 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]

Reply via email to