airflow.providers.google.common.deprecated

AirflowDeprecationAdapter

根据包装对象类型和提供的其他详细信息构建详细的弃用消息。

函数

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

标记类、方法或函数为弃用。

模块内容

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]

基类: deprecated.classic.ClassicAdapter

根据包装对象类型和提供的其他详细信息构建详细的弃用消息。

参数:
  • planned_removal_date (str | None) – 计划移除此弃用对象的日期。建议日期为今日起六个月后。期望的日期格式为 月 DD, YYYY,例如:August 22, 2024。如果未设置 planned_removal_release 参数,则此参数为必需项。

  • planned_removal_release (str | None) – 预计移除此弃用对象的包名和版本。期望的格式为 <包名>==<包版本>,例如 apache-airflow==2.10.0apache-airflow-providers-google==10.22.0。如果未设置 planned_removal_date 参数,则此参数为必需项。

  • use_instead (str | None) – 可选。弃用对象的替代项。

  • reason (str | None) – 可选。弃用此对象的详细原因。

  • instructions (str | None) – 可选。从弃用对象迁移的详细说明。

  • category (type[DeprecationWarning]) – 可选。用于弃用警告的警告类别。

planned_removal_date: datetime.date | None[source]
planned_removal_release: str | None = None[source]
use_instead: str | None = None[source]
reason: str = ''[source]
instructions: str | None = None[source]
category: type[DeprecationWarning][source]
get_deprecated_msg(wrapped, instance)[source]

为包装的可调用对象生成弃用消息。

参数:
  • wrapped (Callable) – 弃用实体。

  • instance (Any) – 可调用对象所属的实例。(未使用)

返回:

包含所有详细信息的格式化弃用消息。

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]

标记类、方法或函数为弃用。

参数:
  • planned_removal_date (str | None) – 计划移除此弃用对象的日期。建议日期为今日起六个月后。期望的日期格式为 月 DD, YYYY,例如:August 22, 2024。如果未设置 planned_removal_release 参数,则此参数为必需项。

  • planned_removal_release (str | None) – 预计移除此弃用对象的包名和版本。期望的格式为 <包名>==<包版本>,例如 apache-airflow==2.10.0apache-airflow-providers-google==10.22.0。如果未设置 planned_removal_date 参数,则此参数为必需项。

  • use_instead (str | None) – 可选。弃用对象的替代项。

  • reason (str | None) – 可选。弃用此对象的详细原因。

  • instructions (str | None) – 可选。从弃用对象迁移的详细说明。

  • adapter_cls (type[AirflowDeprecationAdapter]) – 可选。用于获取弃用消息的适配器类。此项应是 AirflowDeprecationAdapter 的子类。

此条目有帮助吗?