You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "KoviAnusha (via GitHub)" <gi...@apache.org> on 2025/11/16 02:29:34 UTC
[PR] docs: reflect XCOM_RETURN_KEY import change from utils.xcom to models.xcom [airflow]
KoviAnusha opened a new pull request, #58356:
URL: https://github.com/apache/airflow/pull/58356
related: https://github.com/apache/airflow/issues/53693
Reflected the documentation based on the changes in https://github.com/apache/airflow/issues/53065
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
<!-- Please keep an empty line above the dashes. -->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
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](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve XCom documentation by clarifying usage of XCOM_RETURN_KEY constant [airflow]
Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh merged PR #58356:
URL: https://github.com/apache/airflow/pull/58356
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve XCom documentation by clarifying usage of XCOM_RETURN_KEY constant [airflow]
Posted by "KoviAnusha (via GitHub)" <gi...@apache.org>.
KoviAnusha commented on PR #58356:
URL: https://github.com/apache/airflow/pull/58356#issuecomment-3593303057
@amoghrajesh, I have made the required changes as you suggested. Could you please review this PR?
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] docs: reflect XCOM_RETURN_KEY import change from utils.xcom to models.xcom [airflow]
Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on code in PR #58356:
URL: https://github.com/apache/airflow/pull/58356#discussion_r2532972364
##########
airflow-core/docs/core-concepts/xcoms.rst:
##########
@@ -49,6 +49,8 @@ Many operators will auto-push their results into an XCom key called ``return_val
# Pulls the return_value XCOM from "pushing_task"
value = task_instance.xcom_pull(task_ids='pushing_task')
+The ``return_value`` key is defined as a constant ``XCOM_RETURN_KEY`` in the :class:`~airflow.models.xcom.XComModel` class and can be accessed as ``XCom.XCOM_RETURN_KEY`` or imported from ``airflow.models.xcom``. The old ``airflow.utils.xcom`` module has been removed, but backward compatibility is maintained through deprecation shims.
Review Comment:
This isn't correct.
We should not recommend usage from `airflow.models.xcom`, it was been moved inside `BaseXcom` class in task sdk and that is how it should be consumed. The occurrence in models.xcom is only for usage within `XComModel` and should not be put forward this way.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] docs: reflect XCOM_RETURN_KEY import change from utils.xcom to models.xcom [airflow]
Posted by "KoviAnusha (via GitHub)" <gi...@apache.org>.
KoviAnusha commented on PR #58356:
URL: https://github.com/apache/airflow/pull/58356#issuecomment-3537442680
@amoghrajesh, could you please review this PR when you have some time?
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve XCom documentation by clarifying usage of XCOM_RETURN_KEY constant [airflow]
Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on code in PR #58356:
URL: https://github.com/apache/airflow/pull/58356#discussion_r2575680317
##########
airflow-core/docs/core-concepts/xcoms.rst:
##########
@@ -49,6 +49,8 @@ Many operators will auto-push their results into an XCom key called ``return_val
# Pulls the return_value XCOM from "pushing_task"
value = task_instance.xcom_pull(task_ids='pushing_task')
+The return_value key is defined as a constant XCOM_RETURN_KEY in the :class:`~airflow.sdk.bases.xcom.BaseXCom` class and can be accessed as BaseXCom.XCOM_RETURN_KEY.
Review Comment:
```suggestion
The return_value key (default key with which xcoms are pushed) is defined as a constant XCOM_RETURN_KEY in the :class:`~airflow.sdk.bases.xcom.BaseXCom` class and can be accessed as BaseXCom.XCOM_RETURN_KEY.
```
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] docs: reflect XCOM_RETURN_KEY import change from utils.xcom to models.xcom [airflow]
Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on code in PR #58356:
URL: https://github.com/apache/airflow/pull/58356#discussion_r2536481520
##########
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##########
@@ -179,6 +179,15 @@ code import Airflow components correctly in Airflow 3. The older paths are depre
* - ``airflow.io.*``
- ``airflow.sdk.io.*``
+**XCom Module Changes**
+
+The ``airflow.utils.xcom`` module has been removed and its constants moved to more appropriate locations:
+
+- ``XCOM_RETURN_KEY`` constant has been moved from ``airflow.utils.xcom`` to ``airflow.models.xcom``
+- Access the constant as ``XCom.XCOM_RETURN_KEY`` or import from ``airflow.models.xcom``
+- In Task SDK, use ``BaseXCom.XCOM_RETURN_KEY`` or ``XCom.XCOM_RETURN_KEY``
+- The old ``airflow.utils.xcom`` module has been removed, but backward compatibility is maintained through deprecation shims
Review Comment:
Why this change? People who will use the custom xcom backend and we mention that here: https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/xcoms.html, so they will have access to the XCOM_RETURN_KEY anyway, no need to have any changes to this doc.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] docs: reflect XCOM_RETURN_KEY import change from utils.xcom to models.xcom [airflow]
Posted by "KoviAnusha (via GitHub)" <gi...@apache.org>.
KoviAnusha commented on code in PR #58356:
URL: https://github.com/apache/airflow/pull/58356#discussion_r2540250669
##########
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##########
@@ -179,6 +179,15 @@ code import Airflow components correctly in Airflow 3. The older paths are depre
* - ``airflow.io.*``
- ``airflow.sdk.io.*``
+**XCom Module Changes**
+
+The ``airflow.utils.xcom`` module has been removed and its constants moved to more appropriate locations:
+
+- ``XCOM_RETURN_KEY`` constant has been moved from ``airflow.utils.xcom`` to ``airflow.models.xcom``
+- Access the constant as ``XCom.XCOM_RETURN_KEY`` or import from ``airflow.models.xcom``
+- In Task SDK, use ``BaseXCom.XCOM_RETURN_KEY`` or ``XCom.XCOM_RETURN_KEY``
+- The old ``airflow.utils.xcom`` module has been removed, but backward compatibility is maintained through deprecation shims
Review Comment:
Ack
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] docs: reflect XCOM_RETURN_KEY import change from utils.xcom to models.xcom [airflow]
Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on code in PR #58356:
URL: https://github.com/apache/airflow/pull/58356#discussion_r2536484385
##########
airflow-core/docs/core-concepts/xcoms.rst:
##########
@@ -49,6 +49,8 @@ Many operators will auto-push their results into an XCom key called ``return_val
# Pulls the return_value XCOM from "pushing_task"
value = task_instance.xcom_pull(task_ids='pushing_task')
+The ``return_value`` key is defined as a constant ``XCOM_RETURN_KEY`` in the :class:`~airflow.models.xcom.XComModel` class and can be accessed as ``XCom.XCOM_RETURN_KEY`` or imported from ``airflow.models.xcom``. The old ``airflow.utils.xcom`` module has been removed, but backward compatibility is maintained through deprecation shims.
Review Comment:
> The old airflow.utils.xcom module has been removed, but backward compatibility is maintained through deprecation shims.
Is not needed, in the current version of the docs, we do not have to mention the past, since docs are versioned
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] docs: reflect XCOM_RETURN_KEY import change from utils.xcom to models.xcom [airflow]
Posted by "KoviAnusha (via GitHub)" <gi...@apache.org>.
KoviAnusha commented on code in PR #58356:
URL: https://github.com/apache/airflow/pull/58356#discussion_r2536091983
##########
airflow-core/docs/core-concepts/xcoms.rst:
##########
@@ -49,6 +49,8 @@ Many operators will auto-push their results into an XCom key called ``return_val
# Pulls the return_value XCOM from "pushing_task"
value = task_instance.xcom_pull(task_ids='pushing_task')
+The ``return_value`` key is defined as a constant ``XCOM_RETURN_KEY`` in the :class:`~airflow.models.xcom.XComModel` class and can be accessed as ``XCom.XCOM_RETURN_KEY`` or imported from ``airflow.models.xcom``. The old ``airflow.utils.xcom`` module has been removed, but backward compatibility is maintained through deprecation shims.
Review Comment:
Something like this?
The ``return_value`` key is defined as a constant ``XCOM_RETURN_KEY`` in the :class:`~airflow.sdk.bases.xcom.BaseXCom` class and can be accessed as ``BaseXCom.XCOM_RETURN_KEY``. The old ``airflow.utils.xcom`` module has been removed, but backward compatibility is maintained through deprecation shims.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org