Locustv2 commented on issue #31481:
URL: https://github.com/apache/airflow/issues/31481#issuecomment-2142226801
Hey guys, so i encountered a similar issue with another Operator, and it
seem that the issue is with the `expand` part.
So when we are creating a dynamic task mapping on another operator directly,
it works...
Example:
```py
@task
def get_some_data(some_param):
return [ a list of data ]
my_data = get_some_data(xxx)
#task_group
def some_tasks(an_important_param):
@task
def my_simple_task(imp_param):
print(imp_param) ### this prints an item in [ a list of data ]
my_task = my_simple_task(an_important_param)
my_operator = SomePrintOperator( task_id="x_operator",
some_param_to_print=an_important_param) ### assume that this operator just
prints out `some_param_to_print` in the `execute()`
my_task >> my_operator
all_my_tasks = some_tasks.expand(my_data)
my_data >> all_my_tasks
```
So in this example, we have:
- a task `my_data` that just produce some data
- a task group `all_my_tasks` with 2 printing tasks
- `my_task` which is a taskflow function
- `my_operator` which is a subclass of `BaseOperator`
`my_task` works just fine and is able to print an item from the list of data
`my_operator` however prints an object of type `MappedArgument`
This is my issue: https://github.com/apache/airflow/discussions/39927
--
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]