You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by as...@apache.org on 2021/09/10 12:23:12 UTC

[airflow] branch main updated: Mark passing pre/post execute callbacks to operators as experimental. (#18140)

This is an automated email from the ASF dual-hosted git repository.

ash pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 0e3b06b  Mark passing pre/post execute callbacks to operators as experimental. (#18140)
0e3b06b is described below

commit 0e3b06ba2f3898c938c3d191d0c2bc8d85c318c7
Author: Ash Berlin-Taylor <as...@firemirror.com>
AuthorDate: Fri Sep 10 13:22:55 2021 +0100

    Mark passing pre/post execute callbacks to operators as experimental. (#18140)
    
    My primary concern here is that by being able to arbitrarily "change"
    what an operator does will greatly increase the "accidental complexity"
    of both Airflow (for us as developers) and of the DAG itself (for our
    users).
    
    By marking this features as experimental we reserve the right to delete
    it at any point (for instance once we add better methods of doing what
    the OP wanted with these hooks.)
---
 airflow/models/baseoperator.py          | 4 ++++
 docs/apache-airflow/release-process.rst | 2 ++
 docs/conf.py                            | 1 +
 3 files changed, 7 insertions(+)

diff --git a/airflow/models/baseoperator.py b/airflow/models/baseoperator.py
index 6749ee1..fa4014b 100644
--- a/airflow/models/baseoperator.py
+++ b/airflow/models/baseoperator.py
@@ -353,10 +353,14 @@ class BaseOperator(Operator, LoggingMixin, TaskMixin, metaclass=BaseOperatorMeta
     :param pre_execute: a function to be called immediately before task
         execution, receiving a context dictionary; raising an exception will
         prevent the task from being executed.
+
+        |experimental|
     :type pre_execute: TaskPreExecuteHook
     :param post_execute: a function to be called immediately after task
         execution, receiving a context dictionary and task result; raising an
         exception will prevent the task from succeeding.
+
+        |experimental|
     :type post_execute: TaskPostExecuteHook
     :param trigger_rule: defines the rule by which dependencies are applied
         for the task to get triggered. Options are:
diff --git a/docs/apache-airflow/release-process.rst b/docs/apache-airflow/release-process.rst
index dae0545..8de3780 100644
--- a/docs/apache-airflow/release-process.rst
+++ b/docs/apache-airflow/release-process.rst
@@ -82,6 +82,8 @@ So, for example, if we decided to start the deprecation of a function in Airflow
 
 The exception to this deprecation policy is any feature which is marked as "experimental", which *may* suffer breaking changes or complete removal in a Feature release.
 
+.. _experimental:
+
 Experimental features
 =====================
 
diff --git a/docs/conf.py b/docs/conf.py
index feca1ee..705f1a0 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -112,6 +112,7 @@ release = PACKAGE_VERSION
 rst_epilog = f"""
 .. |version| replace:: {version}
 .. |airflow-version| replace:: {airflow.__version__}
+.. |experimental| replace:: This is an :ref:`experimental feature <experimental>`.
 """
 
 # -- General configuration -----------------------------------------------------