dabla commented on code in PR #62922:
URL: https://github.com/apache/airflow/pull/62922#discussion_r4251922651


##########
task-sdk/src/airflow/sdk/bases/decorator.py:
##########
@@ -745,10 +762,72 @@ def _expand(self, expand_input: ExpandInput, *, strict: 
bool) -> XComArg:
             start_trigger_args=self.operator_class.start_trigger_args,
             start_from_trigger=self.operator_class.start_from_trigger,
             returns_dag_result=self.returns_dag_result,
+            register_with_dag=register_with_dag,
         )
         if self.returns_dag_result:
             check_dag_result_outside_loop(operator)
-        return XComArg(operator=operator)
+        return operator
+
+    def iterate(self, **map_kwargs: OperatorExpandArgument) -> XComArg:

Review Comment:
   Agreed, done in 7a448974c0. On the task decorator, `iterate()` / 
`iterate_kwargs()` and `expand()` / `expand_kwargs()` now call 
`_validate_expand_arguments` and `_validate_expand_kwargs_argument` (the 
trigger rule check, the empty check, `_validate_arg_names`, 
`prevent_duplicates`, the teardown rule and the `list[dict]` check), which take 
the caller's name for the messages; `OperatorPartial` got the same pair for its 
own checks. The `expand` messages are unchanged, as the existing core tests on 
them confirm. Only `task_concurrency` stays outside, as it is refused by 
`expand` alone. The `iterate` side had little coverage, so new tests run the 
trigger rule and type checks through both names, and the teardown rule through 
`iterate()`.
   
   Drafted-by: Claude Opus 5.5; reviewed by @dabla before posting
   



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