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) – 預計移除已棄用物件的套件名稱和版本。預期格式為 <package_name>==<package_version>,例如 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]) – 選填。用於棄用警告的警告類別。

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) – 預計移除已棄用物件的套件名稱和版本。預期格式為 <package_name>==<package_version>,例如 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]) – 選填。用於取得棄用訊息的 Adapter 類別。這應該是 AirflowDeprecationAdapter 的子類別。

這個條目有幫助嗎?