airflow.providers.microsoft.azure.hooks.data_factory
¶
Spelling exceptions.
Module Contents¶
Classes¶
Azure Data Factory pipeline operation statuses. |
|
A hook to interact with Azure Data Factory. |
|
An Async Hook that connects to Azure DataFactory to perform pipeline operations. |
Functions¶
|
Provide the targeted factory to the decorated function in case it isn't specified. |
|
Get field from extra, first checking short name, then for backcompat we check for prefixed name. |
Provide the targeted factory to the async decorated function in case it isn't specified. |
Attributes¶
- airflow.providers.microsoft.azure.hooks.data_factory.provide_targeted_factory(func)[source]¶
Provide the targeted factory to the decorated function in case it isn’t specified.
If
resource_group_name
orfactory_name
is not provided it defaults to the value specified in the connection extras.
- class airflow.providers.microsoft.azure.hooks.data_factory.AzureDataFactoryPipelineRunStatus[source]¶
Azure Data Factory pipeline operation statuses.
- exception airflow.providers.microsoft.azure.hooks.data_factory.AzureDataFactoryPipelineRunException[source]¶
Bases:
airflow.exceptions.AirflowException
An exception that indicates a pipeline run failed to complete.
- airflow.providers.microsoft.azure.hooks.data_factory.get_field(extras, field_name, strict=False)[source]¶
Get field from extra, first checking short name, then for backcompat we check for prefixed name.
- class airflow.providers.microsoft.azure.hooks.data_factory.AzureDataFactoryHook(azure_data_factory_conn_id=default_conn_name)[source]¶
Bases:
airflow.hooks.base.BaseHook
A hook to interact with Azure Data Factory.
- Parameters
azure_data_factory_conn_id (str) – The Azure Data Factory connection id.
- classmethod get_connection_form_widgets()[source]¶
Return connection widgets to add to connection form.
- update_factory(factory, resource_group_name, factory_name, if_match=None, **config)[source]¶
Update the factory.
- Parameters
factory (azure.mgmt.datafactory.models.Factory) – The factory resource definition.
resource_group_name (str) – The resource group name.
factory_name (str) – The factory name.
if_match (str | None) – ETag of the factory entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None.
config (Any) – Extra parameters for the ADF client.
- Raises
AirflowException – If the factory does not exist.
- Returns
The factory.
- Return type
azure.mgmt.datafactory.models.Factory
- create_factory(factory, resource_group_name, factory_name, **config)[source]¶
Create the factory.
- Parameters
- Raises
AirflowException – If the factory already exists.
- Returns
The factory.
- Return type
azure.mgmt.datafactory.models.Factory
- get_linked_service(linked_service_name, resource_group_name, factory_name, if_none_match=None, **config)[source]¶
Get the linked service.
- Parameters
linked_service_name (str) – The linked service name.
resource_group_name (str) – The resource group name.
factory_name (str) – The factory name.
if_none_match (str | None) – ETag of the linked service entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None.
config (Any) – Extra parameters for the ADF client.
- Returns
The linked service.
- Return type
azure.mgmt.datafactory.models.LinkedServiceResource | None
- update_linked_service(linked_service_name, linked_service, resource_group_name, factory_name, **config)[source]¶
Update the linked service.
- Parameters
linked_service_name (str) – The linked service name.
linked_service (azure.mgmt.datafactory.models.LinkedServiceResource) – The linked service resource definition.
resource_group_name (str) – The resource group name.
factory_name (str) – The factory name.
config (Any) – Extra parameters for the ADF client.
- Raises
AirflowException – If the linked service does not exist.
- Returns
The linked service.
- Return type
azure.mgmt.datafactory.models.LinkedServiceResource
- create_linked_service(linked_service_name, linked_service, resource_group_name, factory_name, **config)[source]¶
Create the linked service.
- Parameters
linked_service_name (str) – The linked service name.
linked_service (azure.mgmt.datafactory.models.LinkedServiceResource) – The linked service resource definition.
resource_group_name (str) – The resource group name.
factory_name (str) – The factory name.
config (Any) – Extra parameters for the ADF client.
- Raises
AirflowException – If the linked service already exists.
- Returns
The linked service.
- Return type
azure.mgmt.datafactory.models.LinkedServiceResource
- delete_linked_service(linked_service_name, resource_group_name, factory_name, **config)[source]¶
Delete the linked service.
- update_dataset(dataset_name, dataset, resource_group_name, factory_name, **config)[source]¶
Update the dataset.
- Parameters
- Raises
AirflowException – If the dataset does not exist.
- Returns
The dataset.
- Return type
azure.mgmt.datafactory.models.DatasetResource
- create_dataset(dataset_name, dataset, resource_group_name, factory_name, **config)[source]¶
Create the dataset.
- Parameters
- Raises
AirflowException – If the dataset already exists.
- Returns
The dataset.
- Return type
azure.mgmt.datafactory.models.DatasetResource
- delete_dataset(dataset_name, resource_group_name, factory_name, **config)[source]¶
Delete the dataset.
- get_dataflow(dataflow_name, resource_group_name, factory_name, if_none_match=None, **config)[source]¶
Get the dataflow.
- Parameters
dataflow_name (str) – The dataflow name.
resource_group_name (str) – The resource group name.
factory_name (str) – The factory name.
if_none_match (str | None) – ETag of the data flow entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None.
config (Any) – Extra parameters for the ADF client.
- Returns
The DataFlowResource.
- Return type
azure.mgmt.datafactory.models.DataFlowResource
- update_dataflow(dataflow_name, dataflow, resource_group_name, factory_name, if_match=None, **config)[source]¶
Update the dataflow.
- Parameters
dataflow_name (str) – The dataflow name.
dataflow (azure.mgmt.datafactory.models.DataFlowResource | IO) – The dataflow resource definition.
resource_group_name (str) – The resource group name.
factory_name (str) – The factory name.
if_match (str | None) – ETag of the data flow entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None.
config (Any) – Extra parameters for the ADF client.
- Raises
AirflowException – If the dataset does not exist.
- Returns
DataFlowResource.
- Return type
azure.mgmt.datafactory.models.DataFlowResource
- create_dataflow(dataflow_name, dataflow, resource_group_name, factory_name, if_match=None, **config)[source]¶
Create the dataflow.
- Parameters
dataflow_name (str) – The dataflow name.
dataflow (azure.mgmt.datafactory.models.DataFlowResource) – The dataflow resource definition.
resource_group_name (str) – The resource group name.
factory_name (str) – The factory name.
if_match (str | None) – ETag of the factory entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None.
config (Any) – Extra parameters for the ADF client.
- Raises
AirflowException – If the dataset already exists.
- Returns
The dataset.
- Return type
azure.mgmt.datafactory.models.DataFlowResource
- delete_dataflow(dataflow_name, resource_group_name, factory_name, **config)[source]¶
Delete the dataflow.
- update_pipeline(pipeline_name, pipeline, resource_group_name, factory_name, **config)[source]¶
Update the pipeline.
- Parameters
- Raises
AirflowException – If the pipeline does not exist.
- Returns
The pipeline.
- Return type
azure.mgmt.datafactory.models.PipelineResource
- create_pipeline(pipeline_name, pipeline, resource_group_name, factory_name, **config)[source]¶
Create the pipeline.
- Parameters
- Raises
AirflowException – If the pipeline already exists.
- Returns
The pipeline.
- Return type
azure.mgmt.datafactory.models.PipelineResource
- delete_pipeline(pipeline_name, resource_group_name, factory_name, **config)[source]¶
Delete the pipeline.
- get_pipeline_run(run_id, resource_group_name, factory_name, **config)[source]¶
Get the pipeline run.
- get_pipeline_run_status(run_id, resource_group_name, factory_name)[source]¶
Get a pipeline run’s current status.
- wait_for_pipeline_run_status(run_id, expected_statuses, resource_group_name, factory_name, check_interval=60, timeout=60 * 60 * 24 * 7)[source]¶
Wait for a pipeline run to match an expected status.
- Parameters
run_id (str) – The pipeline run identifier.
expected_statuses (str | set[str]) – The desired status(es) to check against a pipeline run’s current status.
resource_group_name (str) – The resource group name.
factory_name (str) – The factory name.
check_interval (int) – Time in seconds to check on a pipeline run’s status.
timeout (int) – Time in seconds to wait for a pipeline to reach a terminal status or the expected status.
- Returns
Boolean indicating if the pipeline run has reached the
expected_status
.- Return type
- cancel_pipeline_run(run_id, resource_group_name, factory_name, **config)[source]¶
Cancel the pipeline run.
- update_trigger(trigger_name, trigger, resource_group_name, factory_name, if_match=None, **config)[source]¶
Update the trigger.
- Parameters
trigger_name (str) – The trigger name.
trigger (azure.mgmt.datafactory.models.TriggerResource) – The trigger resource definition.
resource_group_name (str) – The resource group name.
factory_name (str) – The factory name.
if_match (str | None) – ETag of the trigger entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None.
config (Any) – Extra parameters for the ADF client.
- Raises
AirflowException – If the trigger does not exist.
- Returns
The trigger.
- Return type
azure.mgmt.datafactory.models.TriggerResource
- create_trigger(trigger_name, trigger, resource_group_name, factory_name, **config)[source]¶
Create the trigger.
- Parameters
- Raises
AirflowException – If the trigger already exists.
- Returns
The trigger.
- Return type
azure.mgmt.datafactory.models.TriggerResource
- delete_trigger(trigger_name, resource_group_name, factory_name, **config)[source]¶
Delete the trigger.
- start_trigger(trigger_name, resource_group_name, factory_name, **config)[source]¶
Start the trigger.
- rerun_trigger(trigger_name, run_id, resource_group_name, factory_name, **config)[source]¶
Rerun the trigger.
- airflow.providers.microsoft.azure.hooks.data_factory.provide_targeted_factory_async(func)[source]¶
Provide the targeted factory to the async decorated function in case it isn’t specified.
If
resource_group_name
orfactory_name
is not provided it defaults to the value specified in the connection extras.
- class airflow.providers.microsoft.azure.hooks.data_factory.AzureDataFactoryAsyncHook(azure_data_factory_conn_id=default_conn_name)[source]¶
Bases:
AzureDataFactoryHook
An Async Hook that connects to Azure DataFactory to perform pipeline operations.
- Parameters
azure_data_factory_conn_id (str) – The Azure Data Factory connection id.
- async get_pipeline_run(run_id, resource_group_name, factory_name, **config)[source]¶
Connect to Azure Data Factory asynchronously to get the pipeline run details by run id.
- async get_adf_pipeline_run_status(run_id, resource_group_name, factory_name)[source]¶
Connect to Azure Data Factory asynchronously and get the pipeline status by run_id.