potiuk commented on code in PR #28300: URL: https://github.com/apache/airflow/pull/28300#discussion_r1046532326
########## docs/apache-airflow/public-airflow-api.rst: ########## @@ -0,0 +1,141 @@ + .. 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 API" of Airflow +======================= + +The Public API 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 can include 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 API of Apache Airflow can be useful for building custom tools and integrations with other systems, +as well as for automating certain aspects of the Airflow workflow. + +In general, the public API is an important part of the Airflow ecosystem and can be a powerful tool for users +and developers who want to extend the functionality of the system. + +What kind of APIs are Public in Apache Airflow? +=============================================== + +Apache Airflow has a number of different public APIs that allow developers to interact with various +aspects of the system. Some examples of the types of public APIs exposed as Python objects +that are available in Apache Airflow include: + +* :doc:`DAG <concepts/dags>`_ (Directed Acyclic Graph) APIs, which allow developers to create, manage, + and access DAGs in Airflow. +* :doc:`Task <concepts/tasks>`_ APIs, which provide access to information about individual tasks within + a DAG, such as their dependencies and execution status. +* :doc:`Operator <concepts/operators>`_ APIs, which allows the developers to write their custom Operators. +* :doc:`Decorators <howto/create-custom-decorator>`_ APIs, which allows the developers to write their + custom decorators to make it easier to write :doc:`TaskFlow <tutorial/taskflow>`_ DAGs. +* :doc:`Secret Managers <security/secrets>`_ APIs, which allows the developers to write their custom + Secret Managers to safely access credentials and other secret configuration of their workflows. +* :doc:`Connection management <concepts/connections>`_ APIs, which allow developers to manage + connections to external systems +* :doc:`XCom <concepts/xcoms>`_, which allow developers to manage cross-task communication within Airflow. +* :doc:`Variables <concepts/variables>`_, which allow developers to manage variables within Airflow. +* :doc:`Executors <executor/index>`_, which allow developers to manage the execution of tasks within Airflow. +* :doc:`Plugins <plugins>`_, which allow developers to extend internal Airflow capabilities - add new UI + pages, custom :doc:`TimeTables <concepts/timetable>`_, :doc:`Extra Links <howto/define_extra_link>`_, + :doc:`Listeners <listeners>`_ - all of which are considered public APIs. + +Also Airflow has a stable REST API that allows users to interact with Airflow via HTTP requests and a +CLI that allows users to interact with Airflow via command line commands. + +Overall, the public APIs in Apache Airflow are designed to provide developers with a wide +range of tools and capabilities for interacting with the system and extending its functionality. + +What is not part of the Public API of Apache Airflow? +===================================================== + +A public API of Apache Airflow is a set of programming interfaces that are designed to be used +by developers to access certain features and functionality of the system. As such, not everything in +Apache Airflow is considered to be part of the public API. + +For example, the internal implementation details of Apache Airflow, such as the specific algorithms +and data structures used to manage DAGs and tasks, are not considered to be part of the public API. +These implementation details are not intended to be used by external developers, a +nd are subject to change without notice. + +Additionally, certain features and functionality of Apache Airflow may not be exposed through the public API, +either because they are not considered to be stable or because they are not intended for external use. +In these cases, developers may not be able to access these features through the public API, +and should instead use other available methods for interacting with the system. + +Similarly, :doc:`Database structure <database-erd-ref>`_ is considered to be an internal implementation +detail of Apache Airflow and you should not assume the structure is going to be maintained in +backwards-compatible way. Review Comment: For me, I've been always thought when writing documents is to write what is NOT included. And for me this is always one of the most important part of such document. This cuts down ALL discussions about the subject. And this saves time and explanation when you are sending people to read such document. While I agree this one is pretty vague (written by GPT Chat mostly), I would argue that we MUST have a chapter when we explicitly write "DATABASE IS NOT PUBLIC". If you do not write it here, people might assume it is - and even if this is not logical, they will argue it - sometimes vehemotly: "Well yeah, that DB thing is not included here, but we've always been using it and it's pretty obvious that we can add new columns and fields etc.etc.". I had such a discussion exactly today on slack. The user there did not ask "can I extend the DB of Airlfow" - but "What's the recommended way to do it". Assuming, they can and should do it if they want: https://apache-airflow.slack.com/archives/CSS36QQS1/p1670836953319909 I want to be very clear about DB and few other cases that are likely people will assume can be "public interface". The thing is that If you explicitly mention that something is *not included*, there is no discussion. Whatsoever. Full stop. Don't even mention it. It's explicitly written it is not included and it is not. Discussion is ended at the moment it started. There is a very good reason why in legal docs you write "all the other things not covered by this, including but not limited to X and Y" ... I will change it to be more specific, but I want to say explicitly that some things people are likely to assume to be part of the public interface are NOT. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
