airflow.providers.amazon.aws.utils.deprecation¶
Attributes¶
Functions¶
Tell whether provider code behaves the way it does in |
|
|
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.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.warnthere. Airflow shows aDeprecationWarningonly when it is attributed to anairflowmodule, so one thatstacklevelattributes 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 namesNEXT_MAJOR_VERSIONraises 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_VERSIONinstead 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_versionisNEXT_MAJOR_VERSIONandis_next_major_enabled()is true.