airflow.providers.amazon.aws.utils.deprecation

Attributes

UPGRADE_GUIDE_URL

NEXT_MAJOR_VERSION

Functions

is_next_major_enabled()

Tell whether provider code behaves the way it does in NEXT_MAJOR_VERSION.

warn_deprecated(message, *, removal_version)

Warn that the calling provider code ran a deprecated behaviour.

Module Contents

airflow.providers.amazon.aws.utils.deprecation.UPGRADE_GUIDE_URL = 'https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/upgrading.html'[source]
airflow.providers.amazon.aws.utils.deprecation.NEXT_MAJOR_VERSION = '10.0.0'[source]
airflow.providers.amazon.aws.utils.deprecation.is_next_major_enabled()[source]

Tell whether provider code behaves the way it does in NEXT_MAJOR_VERSION.

Code whose behaviour changes in that version carries both behaviours and asks this each time it runs. Reading it at import time would fix the answer before a test can change it.

airflow.providers.amazon.aws.utils.deprecation.warn_deprecated(message, *, removal_version)[source]

Warn that the calling provider code ran a deprecated behaviour.

Call this from the provider function that implements the deprecated behaviour, instead of calling warnings.warn there. Airflow shows a DeprecationWarning only when it is attributed to an airflow module, so one that stacklevel attributes to a Dag file or to other user code is dropped by Python’s default filters. This warning always passes those filters. It points at the line of user code that called the provider when there is one, and at the calling provider code otherwise.

Once is_next_major_enabled() is true, a deprecation that names NEXT_MAJOR_VERSION raises instead, so the deprecated code acts as removed until it is deleted.

Parameters:
  • message (str) – What is deprecated and what to use instead. The removal release and a link to the upgrade guide are appended.

  • removal_version (str) – The Amazon provider release that removes the deprecated behaviour. Pass NEXT_MAJOR_VERSION instead of a literal: searching for it lists everything that release removes, and if that release has to move, one line moves every removal with it.

Raises:

RemovedFeatureError – When removal_version is NEXT_MAJOR_VERSION and is_next_major_enabled() is true.

Was this entry helpful?