alexdrydew opened a new issue, #38745: URL: https://github.com/apache/airflow/issues/38745
### 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 ```python 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? - [ ] 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: commits-unsubscr...@airflow.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org