You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: airflow-core/docs/public-airflow-interface.rst
+38-65Lines changed: 38 additions & 65 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,8 +26,9 @@ Public Interface for Airflow 3.0+
26
26
`Airflow 2.11 Public Interface Documentation <https://airflow.apache.org/docs/apache-airflow/2.11.0/public-airflow-interface.html>`_
27
27
for the legacy interface.
28
28
29
-
Public Interface of Airflow
30
-
...........................
29
+
30
+
31
+
**Public Interface of Airflow**
31
32
32
33
The Public Interface of Apache Airflow is the collection of interfaces and behaviors in Apache Airflow
33
34
whose changes are governed by semantic versioning. A user interacts with Airflow's public interface
@@ -44,8 +45,7 @@ from task code is no longer allowed. Instead, use the :doc:`Stable REST API <sta
44
45
45
46
For comprehensive Task SDK documentation, see the `Task SDK Reference <https://airflow.apache.org/docs/task-sdk/stable/>`_.
46
47
47
-
Using Airflow Public Interfaces
48
-
===============================
48
+
**Using Airflow Public Interfaces**
49
49
50
50
.. note::
51
51
@@ -87,8 +87,7 @@ in details (such as output format and available flags) so if you want to rely on
87
87
way, the Stable REST API is recommended.
88
88
89
89
90
-
Using the Public Interface for Dag authors
91
-
==========================================
90
+
**Using the Public Interface for Dag authors**
92
91
93
92
The primary interface for Dag authors is the :doc:`airflow.sdk namespace <core-concepts/taskflow>`.
94
93
This provides a stable, well-defined interface for creating DAGs and tasks that is not subject to internal
@@ -140,8 +139,7 @@ All DAGs should update imports to use ``airflow.sdk`` instead of referencing int
140
139
Legacy import paths (e.g., ``airflow.models.dag.DAG``, ``airflow.decorator.task``) are deprecated and will be
141
140
removed in a future Airflow version.
142
141
143
-
Dags
144
-
====
142
+
**Dags**
145
143
146
144
The DAG is Airflow's core entity that represents a recurring workflow. You can create a DAG by
147
145
instantiating the :class:`~airflow.sdk.DAG` class in your DAG file. Dags can also have parameters
@@ -153,7 +151,7 @@ from the airflow.sdk namespace.
153
151
Airflow has a set of example dags that you can use to learn how to write dags
154
152
155
153
.. toctree::
156
-
:includehidden:
154
+
:hidden:
157
155
:glob:
158
156
:maxdepth:1
159
157
@@ -180,8 +178,7 @@ References for the modules used in dags are here:
180
178
181
179
.. _pythonapi:operators:
182
180
183
-
Operators
184
-
=========
181
+
**Operators**
185
182
186
183
The base classes :class:`~airflow.sdk.BaseOperator` and :class:`~airflow.sdk.BaseSensorOperator` are public and may be extended to make new operators.
187
184
@@ -190,8 +187,7 @@ from the airflow.sdk namespace.
190
187
191
188
Subclasses of BaseOperator which are published in Apache Airflow are public in *behavior* but not in *structure*. That is to say, the Operator's parameters and behavior is governed by semver but the methods are subject to change at any time.
192
189
193
-
Task Instances
194
-
==============
190
+
**Task Instances**
195
191
196
192
Task instances are the individual runs of a single task in a DAG (in a DAG Run). Task instances are accessed through
197
193
the Task Context via :func:`~airflow.sdk.get_current_context`. Direct database access is not possible.
@@ -200,8 +196,7 @@ the Task Context via :func:`~airflow.sdk.get_current_context`. Direct database a
200
196
Task Context is part of the airflow.sdk namespace.
201
197
For detailed API documentation, see the `Task SDK Reference <https://airflow.apache.org/docs/task-sdk/stable/>`_.
202
198
203
-
Task Instance Keys
204
-
==================
199
+
**Task Instance Keys**
205
200
206
201
Task instance keys are unique identifiers of task instances in a DAG (in a DAG Run). A key is a tuple that consists of
207
202
``dag_id``, ``task_id``, ``run_id``, ``try_number``, and ``map_index``.
@@ -237,8 +232,7 @@ Example of accessing task instance information through Task Context:
237
232
238
233
.. _pythonapi:hooks:
239
234
240
-
Hooks
241
-
=====
235
+
**Hooks**
242
236
243
237
Hooks are interfaces to external platforms and databases, implementing a common
244
238
interface when possible and acting as building blocks for operators. All hooks
@@ -248,14 +242,13 @@ Airflow has a set of Hooks that are considered public. You are free to extend th
248
242
by extending them:
249
243
250
244
.. toctree::
251
-
:includehidden:
245
+
:hidden:
252
246
:glob:
253
247
:maxdepth:1
254
248
255
249
_api/airflow/hooks/index
256
250
257
-
Public Airflow utilities
258
-
========================
251
+
**Public Airflow utilities**
259
252
260
253
When writing or extending Hooks and Operators, Dag authors and developers can
261
254
use the following classes:
@@ -305,32 +298,29 @@ Reference for classes used for the utilities are here:
305
298
For detailed API documentation, see the `Task SDK Reference <https://airflow.apache.org/docs/task-sdk/stable/>`_.
306
299
307
300
308
-
Public Exceptions
309
-
=================
301
+
**Public Exceptions**
310
302
311
303
When writing the custom Operators and Hooks, you can handle and raise public Exceptions that Airflow
312
304
exposes:
313
305
314
306
.. toctree::
315
-
:includehidden:
307
+
:hidden:
316
308
:glob:
317
309
:maxdepth:1
318
310
319
311
_api/airflow/exceptions/index
320
312
321
-
Public Utility classes
322
-
======================
313
+
**Public Utility classes**
323
314
324
315
.. toctree::
325
-
:includehidden:
316
+
:hidden:
326
317
:glob:
327
318
:maxdepth:1
328
319
329
320
_api/airflow/utils/state/index
330
321
331
322
332
-
Using Public Interface to extend Airflow capabilities
0 commit comments