airflow.providers.google.common.deprecated

Module Contents

Classes

AirflowDeprecationAdapter

Build a detailed deprecation message based on the wrapped object type and other provided details.

Functions

deprecated(*args[, planned_removal_date, ...])

Mark a class, method or a function deprecated.

class airflow.providers.google.common.deprecated.AirflowDeprecationAdapter(planned_removal_date=None, planned_removal_release=None, use_instead=None, reason=None, instructions=None, category=DeprecationWarning, **kwargs)[source]

Bases: deprecated.classic.ClassicAdapter

Build a detailed deprecation message based on the wrapped object type and other provided details.

Parameters
  • planned_removal_date (str | None) – The date after which the deprecated object should be removed. The recommended date is six months ahead from today. The expected date format is Month DD, YYYY, for example: August 22, 2024. This parameter is required if the planned_removal_release parameter is not set.

  • planned_removal_release (str | None) – The package name and the version in which the deprecated object is expected to be removed. The expected format is <package_name>==<package_version>, for example apache-airflow==2.10.0 or apache-airflow-providers-google==10.22.0. This parameter is required if the planned_removal_date parameter is not set.

  • use_instead (str | None) – Optional. Replacement of the deprecated object.

  • reason (str | None) – Optional. The detailed reason for the deprecated object.

  • instructions (str | None) – Optional. The detailed instructions for migrating from the deprecated object.

  • category (type[DeprecationWarning]) – Optional. The warning category to be used for the deprecation warning.

get_deprecated_msg(wrapped, instance)[source]

Generate a deprecation message for wrapped callable.

Parameters
  • wrapped (Callable) – Deprecated entity.

  • instance (Any) – The instance to which the callable belongs. (not used)

Returns

A formatted deprecation message with all the details.

static entity_type(entity)[source]
static entity_path(entity)[source]
sunset_message()[source]
replacement_message()[source]
airflow.providers.google.common.deprecated.deprecated(*args, planned_removal_date=None, planned_removal_release=None, use_instead=None, reason=None, instructions=None, adapter_cls=AirflowDeprecationAdapter, **kwargs)[source]

Mark a class, method or a function deprecated.

Parameters
  • planned_removal_date (str | None) – The date after which the deprecated object should be removed. The recommended date is six months ahead from today. The expected date format is Month DD, YYYY, for example: August 22, 2024. This parameter is required if the planned_removal_release parameter is not set.

  • planned_removal_release (str | None) – The package name and the version in which the deprecated object is expected to be removed. The expected format is <package_name>==<package_version>, for example apache-airflow==2.10.0 or apache-airflow-providers-google==10.22.0. This parameter is required if the planned_removal_date parameter is not set.

  • use_instead (str | None) – Optional. Replacement of the deprecated object.

  • reason (str | None) – Optional. The detailed reason for the deprecated object.

  • instructions (str | None) – Optional. The detailed instructions for migrating from the deprecated object.

  • adapter_cls (type[AirflowDeprecationAdapter]) – Optional. Adapter class that is used to get the deprecation message This should be a subclass of AirflowDeprecationAdapter.

Was this entry helpful?