Apache Airflow version
2.8.4
If "Other Airflow 2 version" selected, which one?
No response
What happened?
It looks like expand_kwargs does not preserve templates that are stored in xcom
What you think should happen instead?
I believe in this case templates should not be rendered as this is the behaviour of basic PlainXComArg.resolve and simple .expand as well
How to reproduce
import datetime
from airflow.decorators import dag, task
@task
def some_task():
return [{"value": "{{ foo }}"}]
@task
def print_task(value):
print(value)
@dag(
schedule=None,
start_date=datetime.datetime(2024, 1, 19),
catchup=False,
)
def pipeline():
print_task.expand_kwargs(some_task())
pipeline().test()
This fails with:
jinja2.exceptions.UndefinedError: 'foo' is undefined
Operating System
macOS 14.2
Versions of Apache Airflow Providers
No response
Deployment
Virtualenv installation
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
Apache Airflow version
2.8.4
If "Other Airflow 2 version" selected, which one?
No response
What happened?
It looks like expand_kwargs does not preserve templates that are stored in xcom
What you think should happen instead?
I believe in this case templates should not be rendered as this is the behaviour of basic
PlainXComArg.resolveand simple.expandas wellHow to reproduce
This fails with:
Operating System
macOS 14.2
Versions of Apache Airflow Providers
No response
Deployment
Virtualenv installation
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
Code of Conduct