sveyret opened a new issue, #50686:
URL: https://github.com/apache/airflow/issues/50686

   ### Apache Airflow version
   
   3.0.1
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   We are using an operator in a dynamic mapping. One of the static values, 
defined in `partial` is a template, using Jinja to extract an XCom value. This 
XCom value is not found by Jinja and replaced with `"None"`.
   
   This was working with version 2.x
   
   ### What you think should happen instead?
   
   We expect the template to be replaced appropriately, as it was in Airflow 
2.x.
   
   ### How to reproduce
   
   In the MVE below, the `show` task is displaying `None` instead of `Show 
this`:
   
   ```python
   from datetime import datetime
   from textwrap import dedent
   
   from airflow import DAG
   from airflow.decorators import task
   from airflow.providers.standard.operators.bash import BashOperator
   
   
   @task
   def build_something():
       return "Show this"
   
   
   @task
   def build_multiple():
       return [{"message": "Also this"}, {"message": "Also that"}]
   
   
   with DAG(
       "mve-xcom-jinja",
       default_args={
           "depends_on_past": False,
       },
       schedule=None,
       start_date=datetime(2025, 1, 1),
       catchup=False,
   ) as dag:
       something = build_something()
   
       multiple = something >> build_multiple()
   
       _ = multiple >> BashOperator.partial(
           task_id="show",
           bash_command=dedent(
               """
               echo "{{ task_instance.xcom_pull(task_ids='build_something') }}"
               echo "$message"
               """
           ),
       ).expand(env=multiple)
   ```
   
   ### Operating System
   
   Debian GNU/Linux 11 (bullseye)
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other Docker-based deployment
   
   ### 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]

Reply via email to