Use the DatabricksReposCreateOperator to create (and optionally checkout) a Databricks Repos via api/2.0/repos API endpoint.

Using the Operator

To use this operator you need to provide at least git_url parameter.



git_url: str

Required HTTPS URL of a Git repository

git_provider: str

Optional name of Git provider. Must be provided if we can’t guess its name from URL. See API documentation for actual list of supported Git providers.

branch: str

Optional name of the existing Git branch to checkout.

tag: str

Optional name of the existing Git tag to checkout.

repo_path: str

Optional path to a Databricks Repos, like, /Repos/<user_email>/repo_name. If not specified, it will be created in the user’s directory.

ignore_existing_repo: bool

Don’t throw exception if repository with given path already exists.

databricks_conn_id: string

the name of the Airflow connection to use.

databricks_retry_limit: integer

amount of times retry if the Databricks backend is unreachable.

databricks_retry_delay: decimal

number of seconds to wait between retries.


Create a Databricks Repo

An example usage of the DatabricksReposCreateOperator is as follows:


    # Example of creating a Databricks Repo
    repo_path = "/Repos/"
    git_url = ""
    create_repo = DatabricksReposCreateOperator(task_id='create_repo', repo_path=repo_path, git_url=git_url)

Was this entry helpful?