Desdroid opened a new issue, #55759:
URL: https://github.com/apache/airflow/issues/55759
### Apache Airflow version
3.0.6
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
I think there is an issue using task groups in combination with dynamic task
mapping.
It seems like one cannot map again over the output of a mapped task_group.
Given this example DAG the task add_10 in the task group will fail with an
UnmappableXComTypePushed: unmappable return type 'int' exception.
```python
import pendulum
from datetime import datetime
from airflow.sdk import task, task_group, dag
import logging
logger = logging.getLogger(__name__)
@dag(
dag_id="test_dag",
dag_display_name="test dynamic task group mapping",
schedule=None,
start_date=datetime(
2021, 6, 27, 0, 0, 0, tzinfo=pendulum.timezone("Europe/Berlin")
),
catchup=False,
description="1.0.0",
)
def test_dag():
@task
def get_nums():
return [1, 2, 3, 4, 5, 6, 7, 8]
@task
def times_2(num):
return num * 2
@task
def add_10(num):
return num + 10
@task
def log_num(text, num):
logger.info(f"{text}{num}")
@task_group
def process_number(num):
_times_2 = times_2(num)
_add_10 = add_10(_times_2)
return _add_10
_get_nums = get_nums()
# _times_2 = times_2.expand(num=_get_nums)
# _add_10 = add_10.expand(num=_times_2)
_processed_numbers = process_number.expand(num=_get_nums)
log_num.partial(text="Got number: ").expand(num=_processed_numbers)
instance = test_dag()
```
### What you think should happen instead?
The returned ints of the mapped task group should be collected into a list
and the log_num task should be executed once for each number in the list.
Similar as documented here:
https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/dynamic-task-mapping.html#depending-on-a-mapped-task-group-s-output
Or is this just a misunderstanding from my side on how dynamic task mapping
works?
### How to reproduce
Copy & Paste the given DAG
### Operating System
Official Airflow Docker Image airflow:slim-3.0.6
### Versions of Apache Airflow Providers
-
### Deployment
Official Apache Airflow Helm Chart
### Deployment details
_No response_
### Anything else?
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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]