airflow.providers.microsoft.azure.bundles.wasb

Classes

WasbDagBundle

WASB Dag bundle - exposes a directory in Azure Blob Storage as a Dag bundle.

Module Contents

class airflow.providers.microsoft.azure.bundles.wasb.WasbDagBundle(*, wasb_conn_id=WasbHook.default_conn_name, container_name, prefix='', **kwargs)[source]

Bases: airflow.dag_processing.bundles.base.BaseDagBundle

WASB Dag bundle - exposes a directory in Azure Blob Storage as a Dag bundle.

This allows Airflow to load Dags directly from an Azure Blob Storage container.

Parameters:
  • wasb_conn_id (str) – Airflow connection ID for Azure Blob Storage. Defaults to WasbHook.default_conn_name.

  • container_name (str) – The name of the blob container containing the Dag files.

  • prefix (str) – Optional subdirectory within the container where the Dags are stored. If empty, Dags are assumed to be at the root of the container.

supports_versioning = False[source]
wasb_conn_id = 'wasb_default'[source]
container_name[source]
prefix = ''[source]
wasb_dags_dir: pathlib.Path[source]
initialize()[source]

Initialize the bundle.

This method is called by the DAG processor and worker before the bundle is used, and allows for deferring expensive operations until that point in time. This will only be called when Airflow needs the bundle files on disk - some uses only need to call the view_url method, which can run without initializing the bundle.

This method must ultimately be safe to call concurrently from different threads or processes. If it isn’t naturally safe, you’ll need to make it so with some form of locking. There is a lock context manager on this class available for this purpose.

If you override this method, ensure you call super().initialize() at the end of your method, after the bundle is initialized, not the beginning.

property wasb_hook: airflow.providers.microsoft.azure.hooks.wasb.WasbHook[source]
__repr__()[source]
get_current_version()[source]

Return the current version of the Dag bundle. Currently not supported.

property path: pathlib.Path[source]

Return the local path to the Dag files.

refresh()[source]

Refresh the Dag bundle by re-downloading the Dags from Azure Blob Storage.

view_url(version=None)[source]

Return a URL for viewing the Dags in Azure Blob Storage. Currently, versioning is not supported.

This method is deprecated and will be removed when the minimum supported Airflow version is 3.1. Use view_url_template instead.

view_url_template()[source]

Return a URL for viewing the Dags in Azure Blob Storage. Currently, versioning is not supported.

Was this entry helpful?