You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2023/01/11 21:25:50 UTC
[airflow] 09/27: Remove outdated Optional Provider Feature outdated documentation (#28506)
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-5-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 65ab1900e1be8295e24bd64d874201cd15ea402e
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Tue Dec 20 21:44:36 2022 +0100
Remove outdated Optional Provider Feature outdated documentation (#28506)
After bumping min_airflow_version to 2.3 the section about optional
provider feature and the way to add it for pre-2.3 compatible providers
is outdated and should be removed.
(cherry picked from commit 9ac76ec52604486d41d0c70984fea51ab2764525)
---
.../howto/create-update-providers.rst | 33 +---------------------
1 file changed, 1 insertion(+), 32 deletions(-)
diff --git a/docs/apache-airflow-providers/howto/create-update-providers.rst b/docs/apache-airflow-providers/howto/create-update-providers.rst
index 173f95c9b5..5231b69a68 100644
--- a/docs/apache-airflow-providers/howto/create-update-providers.rst
+++ b/docs/apache-airflow-providers/howto/create-update-providers.rst
@@ -267,7 +267,7 @@ main Airflow documentation that involves some steps with the providers is also w
Optional provider features
--------------------------
- .. note::
+ .. versionadded:: 2.3.0
This feature is available in Airflow 2.3+.
@@ -280,37 +280,6 @@ Airflow 2.1 and 2.2 silently ignored all ImportErrors coming from providers with
ignoring even important import errors - without giving the clue to Airflow users that there is something
missing in provider dependencies.
-In Airflow 2.3, new exception :class:`~airflow.exceptions.OptionalProviderFeatureException` has been
-introduced and Providers can use the exception to signal that the ImportError (or any other error) should
-be ignored by Airflow ProvidersManager. However this Exception is only available in Airflow 2.3 so if
-providers would like to remain compatible with 2.2, they should continue throwing
-the ImportError exception.
-
-Example code (from Plyvel Hook, part of the Google Provider) explains how such conditional error handling
-should be implemented to keep compatibility with 2.2
-
- .. code-block:: python
-
- try:
- import plyvel
- from plyvel import DB
-
- from airflow.exceptions import AirflowException
- from airflow.hooks.base import BaseHook
-
- except ImportError as e:
- # Plyvel is an optional feature and if imports are missing, it should be silently ignored
- # As of Airflow 2.3 and above the operator can throw OptionalProviderFeatureException
- try:
- from airflow.exceptions import AirflowOptionalProviderFeatureException
- except ImportError:
- # However, in order to keep backwards-compatibility with Airflow 2.1 and 2.2, if the
- # 2.3 exception cannot be imported, the original ImportError should be raised.
- # This try/except can be removed when the provider depends on Airflow >= 2.3.0
- raise e
- raise AirflowOptionalProviderFeatureException(e)
-
-
Using Providers with dynamic task mapping
-----------------------------------------