turbaszek commented on pull request #10153: URL: https://github.com/apache/airflow/pull/10153#issuecomment-688954105
> > I love this change! This DAG representation is nice and clean. I'm just wondering if this will work with AIP-31 approach (`@task` decorator). Especially > > ```python > > @task > > def my_task(): > > ... > > > > with TaskGroup(...) as tg: > > ... > > > > r = my_task() > > r >> tg > > ``` > > Hi, @turbaszek thanks for the detailed review. I have updated the PR accordingly. > > Regarding the question about AIP-31, I just verified it works like a charm. The indentation of your call to `my_task()` needs to be updated to be inside the TaskGroup contextmanager. The lack of indentation was on purpose to check if `TaskGroup` works well with `>>` between `XComArg` which is returned by invoking `my_task()`: https://github.com/apache/airflow/blob/aaf56f9816ed72e18a3215183c185d379b4e4247/airflow/operators/python.py#L291 At least typing here is missing `TaskGroup`: https://github.com/apache/airflow/blob/aaf56f9816ed72e18a3215183c185d379b4e4247/airflow/models/xcom_arg.py#L118-L130 ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
