airflow.providers.databricks.operators.databricks_repos

此模組包含 Databricks operators。

DatabricksReposCreateOperator

使用 POST api/2.0/repos API 端點建立 Databricks 倉庫,並可選地檢出。

DatabricksReposUpdateOperator

使用 PATCH api/2.0/repos API 端點將指定倉庫更新到給定分支或標籤。

DatabricksReposDeleteOperator

使用 DELETE api/2.0/repos API 端點刪除指定倉庫。

模組內容

class airflow.providers.databricks.operators.databricks_repos.DatabricksReposCreateOperator(*, git_url, git_provider=None, branch=None, tag=None, repo_path=None, ignore_existing_repo=False, databricks_conn_id='databricks_default', databricks_retry_limit=3, databricks_retry_delay=1, **kwargs)[source]

基類: airflow.models.BaseOperator

使用 POST api/2.0/repos API 端點建立 Databricks 倉庫,並可選地檢出。

引數:
  • git_url (str) – 必需的 Git 倉庫 HTTPS URL

  • git_provider (str | None) – 可選的 Git 提供商名稱。如果無法從 URL 推斷其名稱,則必須提供。

  • repo_path (str | None) – 倉庫的可選路徑。必須採用 /Repos/{folder}/{repo-name} 格式。如果未指定,將在使用者目錄下建立。

  • branch (str | None) – 要檢出的分支的可選名稱。

  • tag (str | None) – 要檢出的標籤的可選名稱。

  • ignore_existing_repo (bool) – 如果給定路徑的倉庫已存在,則不丟擲異常。

  • databricks_conn_id (str) – 對 Databricks 連線 的引用。預設情況下通常是 databricks_default。要使用基於 token 的身份驗證,請在連線的 extra 欄位中提供 token 鍵,建立 host 鍵並留空 host 欄位。(模板化)

  • databricks_retry_limit (int) – 如果 Databricks 後端不可達,重試的次數。其值必須大於或等於 1。

  • databricks_retry_delay (int) – 重試之間的等待秒數(可以是浮點數)。

template_fields: collections.abc.Sequence[str] = ('repo_path', 'tag', 'branch', 'databricks_conn_id')[source]
__git_providers__[source]
__aws_code_commit_regexp__[source]
__repos_path_regexp__[source]
databricks_conn_id = 'databricks_default'[source]
databricks_retry_limit = 3[source]
databricks_retry_delay = 1[source]
git_url[source]
ignore_existing_repo = False[source]
repo_path = None[source]
branch = None[source]
tag = None[source]
static __detect_repo_provider__(url)[source]
execute(context)[source]

建立一個 Databricks 倉庫。

引數:

context (airflow.sdk.definitions.context.Context) – 上下文

返回:

倉庫 ID

class airflow.providers.databricks.operators.databricks_repos.DatabricksReposUpdateOperator(*, branch=None, tag=None, repo_id=None, repo_path=None, databricks_conn_id='databricks_default', databricks_retry_limit=3, databricks_retry_delay=1, **kwargs)[source]

基類: airflow.models.BaseOperator

使用 PATCH api/2.0/repos API 端點將指定倉庫更新到給定分支或標籤。

參見: https://docs.databricks.com/dev-tools/api/latest/repos.html#operation/update-repo

引數:
  • branch (str | None) – 要更新到的分支的可選名稱。如果省略 tag,則應指定此引數

  • tag (str | None) – 要更新到的標籤的可選名稱。如果省略 branch,則應指定此引數

  • repo_id (str | None) – 現有倉庫的可選 ID。如果省略 repo_path,則應指定此引數

  • repo_path (str | None) – 現有倉庫的可選路徑。如果省略 repo_id,則應指定此引數

  • databricks_conn_id (str) – 對 Databricks 連線 的引用。預設情況下通常是 databricks_default。要使用基於 token 的身份驗證,請在連線的 extra 欄位中提供 token 鍵,建立 host 鍵並留空 host 欄位。(模板化)

  • databricks_retry_limit (int) – 如果 Databricks 後端不可達,重試的次數。其值必須大於或等於 1。

  • databricks_retry_delay (int) – 重試之間的等待秒數(可以是浮點數)。

template_fields: collections.abc.Sequence[str] = ('repo_path', 'tag', 'branch', 'databricks_conn_id')[source]
databricks_conn_id = 'databricks_default'[source]
databricks_retry_limit = 3[source]
databricks_retry_delay = 1[source]
repo_path = None[source]
repo_id = None[source]
branch = None[source]
tag = None[source]
execute(context)[source]

建立 operator 時派生。

上下文與渲染 jinja 模板時使用的字典相同。

請參考 get_template_context 獲取更多上下文資訊。

class airflow.providers.databricks.operators.databricks_repos.DatabricksReposDeleteOperator(*, repo_id=None, repo_path=None, databricks_conn_id='databricks_default', databricks_retry_limit=3, databricks_retry_delay=1, **kwargs)[source]

基類: airflow.models.BaseOperator

使用 DELETE api/2.0/repos API 端點刪除指定倉庫。

參見: https://docs.databricks.com/dev-tools/api/latest/repos.html#operation/delete-repo

引數:
  • repo_id (str | None) – 現有倉庫的可選 ID。如果省略 repo_path,則應指定此引數

  • repo_path (str | None) – 現有倉庫的可選路徑。如果省略 repo_id,則應指定此引數

  • databricks_conn_id (str) – 對 Databricks 連線 的引用。預設情況下通常是 databricks_default。要使用基於 token 的身份驗證,請在連線的 extra 欄位中提供 token 鍵,建立 host 鍵並留空 host 欄位。(模板化)

  • databricks_retry_limit (int) – 如果 Databricks 後端不可達,重試的次數。其值必須大於或等於 1。

  • databricks_retry_delay (int) – 重試之間的等待秒數(可以是浮點數)。

template_fields: collections.abc.Sequence[str] = ('repo_path', 'databricks_conn_id')[source]
databricks_conn_id = 'databricks_default'[source]
databricks_retry_limit = 3[source]
databricks_retry_delay = 1[source]
repo_path = None[source]
repo_id = None[source]
execute(context)[source]

建立 operator 時派生。

上下文與渲染 jinja 模板時使用的字典相同。

請參考 get_template_context 獲取更多上下文資訊。

此條目有幫助嗎?