You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/12/28 22:04:07 UTC

[GitHub] [airflow] dstandish commented on a diff in pull request #28300: Add Public Interface description to Airflow documentation

dstandish commented on code in PR #28300:
URL: https://github.com/apache/airflow/pull/28300#discussion_r1058624408


##########
docs/apache-airflow/administration-and-deployment/public-airflow-interface.rst:
##########
@@ -0,0 +1,87 @@
+ .. 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.
+
+Public Interface of Airflow
+===========================
+
+The Public Interface of Apache Airflow is a set of programmatic interfaces that allow developers to interact
+with and access certain features of the Apache Airflow system. This includes operations such as
+creating and managing DAGs (directed acyclic graphs), managing tasks and their dependencies,
+and extending Airflow capabilities by writing new executors, plugins, operators and providers. The
+Public Interface can be useful for building custom tools and integrations with other systems,
+and for automating certain aspects of the Airflow workflow.
+
+You can extend Airflow in three ways:
+
+* By writing new custom Python code (via Operators, Plugins, Provider)
+* By using the `Stable REST API <stable-rest-api-ref>`_ (based on the OpenAPI specification)
+* By using the `Airflow Command Line Interface (CLI) <cli-and-env-variables-ref.rst>`_
+
+How can you extend Apache Airflow with custom Python Code?
+==========================================================
+
+The Public Interface of Airflow consists of a number of different classes and packages that provide access
+to the core features and functionality of the system.
+
+The classes and packages that may be considered as the Public Interface include:
+
+* The :class:`~airflow.DAG`, which provides a way to define and manage DAGs in Airflow.
+* The :class:`~airflow.models.baseoperator.BaseOperator`, which provides a way write custom operators.
+* The :class:`~airflow.hooks.base.BaseHook`, which provides a way write custom hooks.
+* The :class:`~airflow.models.connection.Connection`, which provides access to external service credentials and configuration.
+* The :class:`~airflow.models.variable.Variable`, which provides access to Airflow configuration variables.
+* The :class:`~airflow.models.xcom.XCom` which are used to access to inter-task communication data.
+* The :class:`~airflow.secrets.BaseSecretsBackend` which are used to define custom secret managers.
+* The :class:`~airflow.plugins_manager.AirflowPlugin` which are used to define custom plugins.
+* The :class:`~airflow.triggers.base.BaseTrigger`, which are used to implement custom Custom Deferrable Operators (based on ``asyncio``).
+* The :class:`~airflow.decorators.base.TaskDecorator`, which provides a way write custom decorators.
+* The :class:`~airflow.listeners.listener.ListenerManager` class which provides hooks that can be implemented to respond to DAG/Task lifecycle events.
+
+.. versionadded:: 2.5
+
+   Listener public interface has been added in version 2.5.
+
+* The :class:`~airflow.executors.base_executor.BaseExecutor` - the Executors are the components of Airflow
+  that are responsible for executing tasks.
+
+.. versionadded:: 2.6
+
+   There are a number of different executor implementations built-in Airflow, each with its own unique
+   characteristics and capabilities. Executor interface was available in earlier version of Airflow but
+   only as of version 2.6 executors are fully decoupled and Airflow does not rely on built-in set of executors.
+   You could have implemented (and succeeded) with implementing Executors before Airflow 2.6 and a number
+   of people succeeded in doing so, but there were some hard-coded behaviours that preferred in-built
+   executors, and custom executors could not provide full functionality that built-in executors had.
+
+
+What is not part of the Public Interface of Apache Airflow?
+===========================================================
+
+Everything not mentioned in this document should be considered as non-Public Interface.

Review Comment:
   This doesn't address providers, or how we can include "private" e.g. helper code in otherwise "public" modules / classes.
   
   Is it sufficient to include `:meta private:`?  Or must we prefix with underscore?



-- 
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