airflow.providers.slack.utils

ConnectionExtraConfig

用於 Connection Extra 的輔助類。

函式

parse_filename(filename, supported_file_formats[, ...])

從給定檔名解析檔案型別和壓縮格式。

包內容

class airflow.providers.slack.utils.ConnectionExtraConfig(conn_type, conn_id=None, extra=None)[source]

用於 Connection Extra 的輔助類。

引數:
  • conn_type (str) – Hook 連線型別。

  • conn_id (str | None) – 用於適當錯誤訊息的連線 ID。

  • extra (dict[str, Any] | None) – 連線 extra 字典。

conn_type[source]
conn_id = None[source]
extra[source]
get(field, default=NOTSET)[source]

從 Connection Extra 獲取指定欄位。

引數:
  • field – Connection extra 欄位名。

  • default (Any) – 如果指定,則在 Connection Extra 中欄位不存在時用作預設值。

getint(field, default=NOTSET)[source]

從 Connection Extra 獲取指定欄位並將其評估為整數。

引數:
  • field – Connection extra 欄位名。

  • default (Any) – 如果指定,則在 Connection Extra 中欄位不存在時用作預設值。

airflow.providers.slack.utils.parse_filename(filename, supported_file_formats, fallback=None)[source]

從給定檔名解析檔案型別和壓縮格式。

引數:
  • filename (str) – 要解析的檔名。

  • supported_file_formats (collections.abc.Sequence[str]) – 支援的副檔名列表。

  • fallback (str | None) – 回退到給定的檔案格式。

返回值:

檔案型別和壓縮格式(如果指定)

返回型別:

tuple[str, str | None]

這條內容有幫助嗎?