Closed asherkhb-ktx closed 1 year ago
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
I fear this is a mis-understanding. I have never seen it working - and would be surprised if it is - that you can map on additional XCom results like you went down with names
.
What you should consider trying to to use a mapping function to transform the XCom results for the data you are looking for as described in https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/dynamic-task-mapping.html#transforming-expanding-data
Agree with Jens. I convert it into discussion in case more is needed, I do not see it as an issue. CC: @uranusjr for more insight- maybe you have some comments there.
Apache Airflow version
2.7.2
What happened
When attempting to use dynamic task mapping over a task_group() based on a non-standard XCom (e.g. NOT return_value), the group expands to n=len(return_value) instances instead of n=len(specified_key).
Dynamic instances which correspond to a valid index in the specified_key succeed, but...
What you think should happen instead
The task_group should expand over the length of the specified XCom value
How to reproduce
Consider the following DAG; you would expect
greet_by_name
to run three times but it instead only runs twice.If additional outputs are added to the
get_greetings
task then the task_group will expand accordingly (e.g. to 4 tasks) but some will fail:Operating System
Debian GNU/Linux 11 (bullseye)
Versions of Apache Airflow Providers
No response
Deployment
Other Docker-based deployment
Deployment details
No response
Anything else
No response
Are you willing to submit PR?
Code of Conduct