Skip to content

Conversation

@amoghrajesh
Copy link
Contributor

closes: #53065

All of the occurrences have been handled, just added one missing one in devel-common.

Tested for backcompat issues as users could potentially be using the XCOM_RETURN_KEY from older paths.

DAG:

from airflow.providers.standard.operators.python import PythonOperator
from airflow.sdk import DAG
from airflow.providers.standard.operators.bash import BashOperator


def my_func():
    from airflow.models.xcom import XCOM_RETURN_KEY

    print("New path for return key", XCOM_RETURN_KEY)

    from airflow.utils.xcom import XCOM_RETURN_KEY as old_xcom_return_key
    print("Old path for return key", old_xcom_return_key)

dag = DAG(
    'simple_bash',
    schedule=None,
    catchup=False,
    tags=['example'],
)

hello_task = BashOperator(
    task_id='say_hello',
    bash_command='echo "Hello World from Airflow!"',
    dag=dag,
)

hello_task2 = PythonOperator(
    task_id='say_hello_python',
    python_callable=my_func,
    dag=dag,
)

hello_task >> hello_task2
image

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@amoghrajesh amoghrajesh requested review from ashb, kaxil and potiuk July 11, 2025 14:12
@kaxil kaxil added this to the Airflow 3.1.0 milestone Jul 11, 2025
@amoghrajesh amoghrajesh self-assigned this Jul 14, 2025
@amoghrajesh amoghrajesh merged commit e6a4f2a into apache:main Jul 14, 2025
102 checks passed
@amoghrajesh amoghrajesh deleted the nuke-xcom-utils branch July 14, 2025 14:42
prdai pushed a commit to prdai/airflow that referenced this pull request Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean up the airflow.utils.xcom module and move it to relevant places

6 participants