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


##########
airflow-core/src/airflow/ti_deps/deps/trigger_rule_dep.py:
##########
@@ -147,10 +147,8 @@ def _get_expanded_ti_count() -> int:
             return get_mapped_ti_count(ti.task, ti.run_id, session=session)
 
         def _iter_expansion_dependencies(task_group: MappedTaskGroup) -> 
Iterator[str]:
-            from airflow.sdk.definitions.mappedoperator import MappedOperator
-
-            if isinstance(ti.task, MappedOperator):
-                for op in ti.task.iter_mapped_dependencies():
+            if (task := ti.task) is not None and is_mapped(task):
+                for op in task.iter_mapped_dependencies():
                     yield op.task_id

Review Comment:
   Personally I prefer an explicit loop here since it’s more readable (and 
actually less characters) than `yield from (comprehension expression)`



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