airflow.providers.microsoft.azure.hooks.data_factory
¶
Module Contents¶
Classes¶
Type class for the pipeline run info dictionary. |
|
Azure Data Factory pipeline operation statuses. |
|
A hook to interact with Azure Data Factory. |
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. |
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.PipelineRunInfo[source]¶
Bases:
airflow.typing_compat.TypedDict
Type class for the pipeline run info dictionary.
- 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.
- update_factory(factory, resource_group_name=None, factory_name=None, **config)[source]¶
Update the factory.
- Parameters
- Raises
AirflowException – If the factory does not exist.
- Returns
The factory.
- Return type
azure.mgmt.datafactory.models.Factory
- create_factory(factory, resource_group_name=None, factory_name=None, **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=None, factory_name=None, **config)[source]¶
Get the linked service.
- Parameters
- Returns
The linked service.
- Return type
azure.mgmt.datafactory.models.LinkedServiceResource
- update_linked_service(linked_service_name, linked_service, resource_group_name=None, factory_name=None, **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 | None) – The resource group name.
factory_name (str | None) – 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=None, factory_name=None, **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 | None) – The resource group name.
factory_name (str | None) – 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=None, factory_name=None, **config)[source]¶
Delete the linked service.
- get_dataset(dataset_name, resource_group_name=None, factory_name=None, **config)[source]¶
Get the dataset.
- update_dataset(dataset_name, dataset, resource_group_name=None, factory_name=None, **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=None, factory_name=None, **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=None, factory_name=None, **config)[source]¶
Delete the dataset.
- get_dataflow(dataflow_name, resource_group_name=None, factory_name=None, **config)[source]¶
Get the dataflow.
- update_dataflow(dataflow_name, dataflow, resource_group_name=None, factory_name=None, **config)[source]¶
Update the dataflow.
- Parameters
- Raises
AirflowException – If the dataset does not exist.
- Returns
The dataflow.
- Return type
azure.mgmt.datafactory.models.DataFlow
- create_dataflow(dataflow_name, dataflow, resource_group_name=None, factory_name=None, **config)[source]¶
Create the dataflow.
- Parameters
- Raises
AirflowException – If the dataset already exists.
- Returns
The dataset.
- Return type
azure.mgmt.datafactory.models.DataFlow
- delete_dataflow(dataflow_name, resource_group_name=None, factory_name=None, **config)[source]¶
Delete the dataflow.
- get_pipeline(pipeline_name, resource_group_name=None, factory_name=None, **config)[source]¶
Get the pipeline.
- update_pipeline(pipeline_name, pipeline, resource_group_name=None, factory_name=None, **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=None, factory_name=None, **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=None, factory_name=None, **config)[source]¶
Delete the pipeline.
- run_pipeline(pipeline_name, resource_group_name=None, factory_name=None, **config)[source]¶
Run a pipeline.
- get_pipeline_run(run_id, resource_group_name=None, factory_name=None, **config)[source]¶
Get the pipeline run.
- get_pipeline_run_status(run_id, resource_group_name=None, factory_name=None)[source]¶
Get a pipeline run’s current status.
- wait_for_pipeline_run_status(run_id, expected_statuses, resource_group_name=None, factory_name=None, check_interval=60, timeout=60 * 60 * 24 * 7)[source]¶
Waits 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 | None) – The resource group name.
factory_name (str | None) – 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=None, factory_name=None, **config)[source]¶
Cancel the pipeline run.
- get_trigger(trigger_name, resource_group_name=None, factory_name=None, **config)[source]¶
Get the trigger.
- update_trigger(trigger_name, trigger, resource_group_name=None, factory_name=None, **config)[source]¶
Update the trigger.
- Parameters
- 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=None, factory_name=None, **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=None, factory_name=None, **config)[source]¶
Delete the trigger.
- start_trigger(trigger_name, resource_group_name=None, factory_name=None, **config)[source]¶
Start the trigger.
- stop_trigger(trigger_name, resource_group_name=None, factory_name=None, **config)[source]¶
Stop the trigger.
- rerun_trigger(trigger_name, run_id, resource_group_name=None, factory_name=None, **config)[source]¶
Rerun the trigger.