- Notifications
You must be signed in to change notification settings - Fork 16.2k
Closed
Labels
area:corearea:dynamic-task-mappingAIP-42AIP-42kind:bugThis is a clearly a bugThis is a clearly a bugpriority:mediumBug that should be fixed before next release but would not block a releaseBug that should be fixed before next release but would not block a release
Milestone
Description
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:
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
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
area:corearea:dynamic-task-mappingAIP-42AIP-42kind:bugThis is a clearly a bugThis is a clearly a bugpriority:mediumBug that should be fixed before next release but would not block a releaseBug that should be fixed before next release but would not block a release