You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/06/02 10:12:36 UTC
[GitHub] [airflow] hussein-awala commented on issue #31677: Task ser/des not working for multiple return values
hussein-awala commented on issue #31677:
URL: https://github.com/apache/airflow/issues/31677#issuecomment-1573490372
This is not a bug. It is not possible to unpack an Xcom in parsing time because it does not exist at that moment. Xcom is created at runtime after the first task is executed:
```python
from datetime import datetime
from airflow.decorators import dag, task
@dag(schedule=None, start_date=datetime(2023, 1, 1), catchup=False)
def testdag():
@task()
def test():
return 'x', 'y'
@task()
def process_x(values):
x = values[0]
print(x)
@task()
def process_y(values):
y = values[1]
print(y)
returned_values = test()
process_x(returned_values)
process_y(returned_values)
testdag()
```
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org