Skip to content

Commit e95f771

Browse files
committed
Make Public interface for Airflow 3 and add link for Airflow 2.11
1 parent c8a545a commit e95f771

File tree

4 files changed

+205
-219
lines changed

4 files changed

+205
-219
lines changed

airflow-core/docs/core-concepts/variables.rst

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,19 @@ To use them, just import and call ``get`` on the Variable model::
3333
# Returns the value of default (None) if the variable is not set
3434
baz = Variable.get("baz", default=None)
3535

36-
.. versionchanged:: 3.0
36+
You can also access variables through the Task Context using
37+
:func:`~airflow.sdk.get_current_context`:
3738

38-
In Airflow 3.0+, you can also access variables through the Task Context using
39-
:func:`~airflow.sdk.get_current_context`:
39+
.. code-block:: python
4040
41-
.. code-block:: python
41+
from airflow.sdk import get_current_context
4242
43-
from airflow.sdk import get_current_context
4443
45-
46-
def my_task():
47-
context = get_current_context()
48-
var = context["var"]
49-
my_variable = var.get("my_variable_name")
50-
return my_variable
44+
def my_task():
45+
context = get_current_context()
46+
var = context["var"]
47+
my_variable = var.get("my_variable_name")
48+
return my_variable
5149
5250
You can also use them from :ref:`templates <concepts:jinja-templating>`::
5351

airflow-core/docs/core-concepts/xcoms.rst

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ XComs (short for "cross-communications") are a mechanism that let :doc:`tasks` t
2525

2626
An XCom is identified by a ``key`` (essentially its name), as well as the ``task_id`` and ``dag_id`` it came from. They can have any serializable value (including objects that are decorated with ``@dataclass`` or ``@attr.define``, see :ref:`TaskFlow arguments <concepts:arbitrary-arguments>`:), but they are only designed for small amounts of data; do not use them to pass around large values, like dataframes.
2727

28-
.. versionchanged:: 3.0
29-
30-
In Airflow 3.0+, XCom operations should be performed through the Task Context using
31-
:func:`~airflow.sdk.get_current_context`. Direct database access is not possible.
28+
XCom operations should be performed through the Task Context using
29+
:func:`~airflow.sdk.get_current_context`. Direct database access is not possible.
3230

3331
XComs are explicitly "pushed" and "pulled" to/from their storage using the ``xcom_push`` and ``xcom_pull`` methods on Task Instances.
3432

@@ -78,26 +76,24 @@ An example of pushing multiple XComs and pulling them individually:
7876
# Pulling entire xcom data from push_multiple task
7977
data = context["ti"].xcom_pull(task_ids="push_multiple", key="return_value")
8078
81-
.. versionchanged:: 3.0
82-
83-
In Airflow 3.0+, you can also use the Task Context directly for XCom operations:
79+
You can also use the Task Context directly for XCom operations:
8480

85-
.. code-block:: python
81+
.. code-block:: python
8682
87-
from airflow.sdk import get_current_context
83+
from airflow.sdk import get_current_context
8884
8985
90-
@task
91-
def example_task():
92-
context = get_current_context()
93-
ti = context["ti"]
86+
@task
87+
def example_task():
88+
context = get_current_context()
89+
ti = context["ti"]
9490
95-
# Push XCom
96-
ti.xcom_push(key="my_key", value="my_value")
91+
# Push XCom
92+
ti.xcom_push(key="my_key", value="my_value")
9793
98-
# Pull XCom
99-
value = ti.xcom_pull(task_ids="previous_task", key="my_key")
100-
return value
94+
# Pull XCom
95+
value = ti.xcom_pull(task_ids="previous_task", key="my_key")
96+
return value
10197
10298
.. note::
10399

@@ -117,10 +113,8 @@ The XCom system has interchangeable backends, and you can set which backend is b
117113

118114
If you want to implement your own backend, you should subclass :class:`~airflow.sdk.execution_time.xcom.XCom`, and override the ``serialize_value`` and ``deserialize_value`` methods.
119115

120-
.. versionchanged:: 3.0
121-
122-
The base class for custom XCom backends is now :class:`~airflow.sdk.execution_time.xcom.XCom`
123-
from the airflow.sdk namespace.
116+
The base class for custom XCom backends is now :class:`~airflow.sdk.execution_time.xcom.XCom`
117+
from the airflow.sdk namespace.
124118

125119
You can override the ``purge`` method in the ``BaseXCom`` class to have control over purging the xcom data from the custom backend. This will be called as part of ``delete``.
126120

airflow-core/docs/howto/connection.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ Managing Connections
2222

2323
For an overview of hooks and connections, see :doc:`/authoring-and-scheduling/connections`.
2424

25-
.. versionchanged:: 3.0
26-
27-
Direct metadata-model access to :class:`~airflow.models.connection.Connection` in task or management code is deprecated.
28-
Use the public SDK API (:class:`~airflow.sdk.Connection`), the Stable REST API, or the Python Client instead.
29-
3025
Airflow's :class:`~airflow.sdk.Connection` object is used for storing credentials and other information necessary for connecting to external services.
3126

3227
Connections may be defined in the following ways:

0 commit comments

Comments
 (0)