This is an automated email from the ASF dual-hosted git repository.
uranusjr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 3a0b8bded9 Add D400 pydocstyle check - Microsoft provider only (#31425)
3a0b8bded9 is described below
commit 3a0b8bded98a1f8256765e5b829c2ba4f1b0369a
Author: Vincent <[email protected]>
AuthorDate: Mon Jun 5 00:09:05 2023 -0400
Add D400 pydocstyle check - Microsoft provider only (#31425)
---
airflow/providers/microsoft/azure/hooks/adx.py | 4 +--
airflow/providers/microsoft/azure/hooks/asb.py | 20 ++++++------
.../providers/microsoft/azure/hooks/base_azure.py | 4 +--
airflow/providers/microsoft/azure/hooks/batch.py | 28 ++++++++--------
.../microsoft/azure/hooks/container_instance.py | 14 ++++----
.../microsoft/azure/hooks/container_registry.py | 4 +--
.../microsoft/azure/hooks/container_volume.py | 8 ++---
airflow/providers/microsoft/azure/hooks/cosmos.py | 10 +++---
.../microsoft/azure/hooks/data_factory.py | 16 ++++-----
.../providers/microsoft/azure/hooks/data_lake.py | 28 ++++++++--------
.../providers/microsoft/azure/hooks/fileshare.py | 4 +--
airflow/providers/microsoft/azure/hooks/synapse.py | 4 +--
airflow/providers/microsoft/azure/hooks/wasb.py | 16 ++++-----
.../microsoft/azure/log/wasb_task_handler.py | 5 +--
.../providers/microsoft/azure/operators/adls.py | 2 +-
airflow/providers/microsoft/azure/operators/adx.py | 10 +++---
airflow/providers/microsoft/azure/operators/asb.py | 38 +++++++++++-----------
.../providers/microsoft/azure/operators/batch.py | 4 +--
.../azure/operators/container_instances.py | 2 +-
.../providers/microsoft/azure/operators/cosmos.py | 2 +-
.../providers/microsoft/azure/secrets/key_vault.py | 6 ++--
.../providers/microsoft/azure/sensors/cosmos.py | 5 ++-
.../microsoft/azure/sensors/data_factory.py | 2 +-
airflow/providers/microsoft/azure/sensors/wasb.py | 4 +--
.../microsoft/azure/transfers/azure_blob_to_gcs.py | 2 +-
.../microsoft/azure/transfers/local_to_adls.py | 2 +-
.../microsoft/azure/transfers/sftp_to_wasb.py | 4 +--
.../microsoft/azure/triggers/data_factory.py | 8 ++---
airflow/providers/microsoft/mssql/hooks/mssql.py | 6 ++--
.../providers/microsoft/mssql/operators/mssql.py | 2 +-
30 files changed, 133 insertions(+), 131 deletions(-)
diff --git a/airflow/providers/microsoft/azure/hooks/adx.py
b/airflow/providers/microsoft/azure/hooks/adx.py
index 634c18c172..8b892ea2ae 100644
--- a/airflow/providers/microsoft/azure/hooks/adx.py
+++ b/airflow/providers/microsoft/azure/hooks/adx.py
@@ -78,7 +78,7 @@ class AzureDataExplorerHook(BaseHook):
@staticmethod
def get_connection_form_widgets() -> dict[str, Any]:
- """Returns connection widgets to add to connection form"""
+ """Returns connection widgets to add to connection form."""
from flask_appbuilder.fieldwidgets import BS3PasswordFieldWidget,
BS3TextFieldWidget
from flask_babel import lazy_gettext
from wtforms import PasswordField, StringField
@@ -97,7 +97,7 @@ class AzureDataExplorerHook(BaseHook):
@staticmethod
@_ensure_prefixes(conn_type="azure_data_explorer")
def get_ui_field_behaviour() -> dict[str, Any]:
- """Returns custom field behaviour"""
+ """Returns custom field behaviour."""
return {
"hidden_fields": ["schema", "port", "extra"],
"relabeling": {
diff --git a/airflow/providers/microsoft/azure/hooks/asb.py
b/airflow/providers/microsoft/azure/hooks/asb.py
index 3a25cfd56d..0cfedbf514 100644
--- a/airflow/providers/microsoft/azure/hooks/asb.py
+++ b/airflow/providers/microsoft/azure/hooks/asb.py
@@ -26,7 +26,7 @@ from airflow.hooks.base import BaseHook
class BaseAzureServiceBusHook(BaseHook):
"""
- BaseAzureServiceBusHook class to create session and create connection
using connection string
+ BaseAzureServiceBusHook class to create session and create connection
using connection string.
:param azure_service_bus_conn_id: Reference to the
:ref:`Azure Service Bus
connection<howto/connection:azure_service_bus>`.
@@ -39,7 +39,7 @@ class BaseAzureServiceBusHook(BaseHook):
@staticmethod
def get_ui_field_behaviour() -> dict[str, Any]:
- """Returns custom field behaviour"""
+ """Returns custom field behaviour."""
return {
"hidden_fields": ["port", "host", "extra", "login", "password"],
"relabeling": {"schema": "Connection String"},
@@ -61,13 +61,13 @@ class AdminClientHook(BaseAzureServiceBusHook):
Interacts with ServiceBusAdministrationClient client
to create, update, list, and delete resources of a
Service Bus namespace. This hook uses the same Azure Service Bus client
connection inherited
- from the base class
+ from the base class.
"""
def get_conn(self) -> ServiceBusAdministrationClient:
"""
Create and returns ServiceBusAdministrationClient by using the
connection
- string in connection details
+ string in connection details.
"""
conn = self.get_connection(self.conn_id)
@@ -82,7 +82,7 @@ class AdminClientHook(BaseAzureServiceBusHook):
enable_batched_operations: bool = True,
) -> QueueProperties:
"""
- Create Queue by connecting to service Bus Admin client return the
QueueProperties
+ Create Queue by connecting to service Bus Admin client return the
QueueProperties.
:param queue_name: The name of the queue or a QueueProperties with
name.
:param max_delivery_count: The maximum delivery count. A message is
automatically
@@ -106,7 +106,7 @@ class AdminClientHook(BaseAzureServiceBusHook):
def delete_queue(self, queue_name: str) -> None:
"""
- Delete the queue by queue_name in service bus namespace
+ Delete the queue by queue_name in service bus namespace.
:param queue_name: The name of the queue or a QueueProperties with
name.
"""
@@ -118,7 +118,7 @@ class AdminClientHook(BaseAzureServiceBusHook):
def delete_subscription(self, subscription_name: str, topic_name: str) ->
None:
"""
- Delete a topic subscription entities under a ServiceBus Namespace
+ Delete a topic subscription entities under a ServiceBus Namespace.
:param subscription_name: The subscription name that will own the rule
in topic
:param topic_name: The topic that will own the subscription rule.
@@ -140,7 +140,7 @@ class MessageHook(BaseAzureServiceBusHook):
"""
def get_conn(self) -> ServiceBusClient:
- """Create and returns ServiceBusClient by using the connection string
in connection details"""
+ """Create and returns ServiceBusClient by using the connection string
in connection details."""
conn = self.get_connection(self.conn_id)
connection_string: str = str(conn.schema)
@@ -150,7 +150,7 @@ class MessageHook(BaseAzureServiceBusHook):
def send_message(self, queue_name: str, messages: str | list[str],
batch_message_flag: bool = False):
"""
By using ServiceBusClient Send message(s) to a Service Bus Queue. By
using
- batch_message_flag it enables and send message as batch message
+ batch_message_flag it enables and send message as batch message.
:param queue_name: The name of the queue or a QueueProperties with
name.
:param messages: Message which needs to be sent to the queue. It can
be string or list of string.
@@ -193,7 +193,7 @@ class MessageHook(BaseAzureServiceBusHook):
self, queue_name, max_message_count: int | None = 1, max_wait_time:
float | None = None
):
"""
- Receive a batch of messages at once in a specified Queue name
+ Receive a batch of messages at once in a specified Queue name.
:param queue_name: The name of the queue name or a QueueProperties
with name.
:param max_message_count: Maximum number of messages in the batch.
diff --git a/airflow/providers/microsoft/azure/hooks/base_azure.py
b/airflow/providers/microsoft/azure/hooks/base_azure.py
index 41c5ac70b3..4190a2bf03 100644
--- a/airflow/providers/microsoft/azure/hooks/base_azure.py
+++ b/airflow/providers/microsoft/azure/hooks/base_azure.py
@@ -42,7 +42,7 @@ class AzureBaseHook(BaseHook):
@staticmethod
def get_connection_form_widgets() -> dict[str, Any]:
- """Returns connection widgets to add to connection form"""
+ """Returns connection widgets to add to connection form."""
from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
from flask_babel import lazy_gettext
from wtforms import StringField
@@ -58,7 +58,7 @@ class AzureBaseHook(BaseHook):
@staticmethod
def get_ui_field_behaviour() -> dict[str, Any]:
- """Returns custom field behaviour"""
+ """Returns custom field behaviour."""
import json
return {
diff --git a/airflow/providers/microsoft/azure/hooks/batch.py
b/airflow/providers/microsoft/azure/hooks/batch.py
index e16e118fa9..a5494b94ca 100644
--- a/airflow/providers/microsoft/azure/hooks/batch.py
+++ b/airflow/providers/microsoft/azure/hooks/batch.py
@@ -33,7 +33,7 @@ from airflow.utils import timezone
class AzureBatchHook(BaseHook):
"""
- Hook for Azure Batch APIs
+ Hook for Azure Batch APIs.
:param azure_batch_conn_id: :ref:`Azure Batch connection
id<howto/connection:azure_batch>`
of a service principal which will be used to start the container
instance.
@@ -54,7 +54,7 @@ class AzureBatchHook(BaseHook):
@staticmethod
def get_connection_form_widgets() -> dict[str, Any]:
- """Returns connection widgets to add to connection form"""
+ """Returns connection widgets to add to connection form."""
from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
from flask_babel import lazy_gettext
from wtforms import StringField
@@ -65,7 +65,7 @@ class AzureBatchHook(BaseHook):
@staticmethod
def get_ui_field_behaviour() -> dict[str, Any]:
- """Returns custom field behaviour"""
+ """Returns custom field behaviour."""
return {
"hidden_fields": ["schema", "port", "host", "extra"],
"relabeling": {
@@ -80,13 +80,13 @@ class AzureBatchHook(BaseHook):
self.connection = self.get_conn()
def _connection(self) -> Connection:
- """Get connected to Azure Batch service"""
+ """Get connected to Azure Batch service."""
conn = self.get_connection(self.conn_id)
return conn
def get_conn(self):
"""
- Get the Batch client connection
+ Get the Batch client connection.
:return: Azure Batch client
"""
@@ -118,7 +118,7 @@ class AzureBatchHook(BaseHook):
**kwargs,
) -> PoolAddParameter:
"""
- Configures a pool
+ Configures a pool.
:param pool_id: A string that uniquely identifies the Pool within the
Account
@@ -203,7 +203,7 @@ class AzureBatchHook(BaseHook):
def create_pool(self, pool: PoolAddParameter) -> None:
"""
- Creates a pool if not already existing
+ Creates a pool if not already existing.
:param pool: the pool object to create
@@ -225,7 +225,7 @@ class AzureBatchHook(BaseHook):
sku_starts_with: str | None = None,
) -> tuple:
"""
- Get latest verified image vm and sku
+ Get latest verified image vm and sku.
:param publisher: The publisher of the Azure Virtual Machines
Marketplace Image.
For example, Canonical or MicrosoftWindowsServer.
@@ -250,7 +250,7 @@ class AzureBatchHook(BaseHook):
def wait_for_all_node_state(self, pool_id: str, node_state: set) -> list:
"""
- Wait for all nodes in a pool to reach given states
+ Wait for all nodes in a pool to reach given states.
:param pool_id: A string that identifies the pool
:param node_state: A set of batch_models.ComputeNodeState
@@ -278,7 +278,7 @@ class AzureBatchHook(BaseHook):
**kwargs,
) -> JobAddParameter:
"""
- Configures a job for use in the pool
+ Configures a job for use in the pool.
:param job_id: A string that uniquely identifies the job within the
account
:param pool_id: A string that identifies the pool
@@ -294,7 +294,7 @@ class AzureBatchHook(BaseHook):
def create_job(self, job: JobAddParameter) -> None:
"""
- Creates a job in the pool
+ Creates a job in the pool.
:param job: The job object to create
"""
@@ -316,7 +316,7 @@ class AzureBatchHook(BaseHook):
**kwargs,
) -> TaskAddParameter:
"""
- Creates a task
+ Creates a task.
:param task_id: A string that identifies the task to create
:param command_line: The command line of the Task.
@@ -338,7 +338,7 @@ class AzureBatchHook(BaseHook):
def add_single_task_to_job(self, job_id: str, task: TaskAddParameter) ->
None:
"""
- Add a single task to given job if it doesn't exist
+ Add a single task to given job if it doesn't exist.
:param job_id: A string that identifies the given job
:param task: The task to add
@@ -354,7 +354,7 @@ class AzureBatchHook(BaseHook):
def wait_for_job_tasks_to_complete(self, job_id: str, timeout: int) ->
list[batch_models.CloudTask]:
"""
- Wait for tasks in a particular job to complete
+ Wait for tasks in a particular job to complete.
:param job_id: A string that identifies the job
:param timeout: The amount of time to wait before timing out in minutes
diff --git a/airflow/providers/microsoft/azure/hooks/container_instance.py
b/airflow/providers/microsoft/azure/hooks/container_instance.py
index 791819c3ec..9a0d0ec210 100644
--- a/airflow/providers/microsoft/azure/hooks/container_instance.py
+++ b/airflow/providers/microsoft/azure/hooks/container_instance.py
@@ -51,7 +51,7 @@ class AzureContainerInstanceHook(AzureBaseHook):
def create_or_update(self, resource_group: str, name: str,
container_group: ContainerGroup) -> None:
"""
- Create a new container group
+ Create a new container group.
:param resource_group: the name of the resource group
:param name: the name of the container group
@@ -61,7 +61,7 @@ class AzureContainerInstanceHook(AzureBaseHook):
def get_state_exitcode_details(self, resource_group: str, name: str) ->
tuple:
"""
- Get the state and exitcode of a container group
+ Get the state and exitcode of a container group.
:param resource_group: the name of the resource group
:param name: the name of the container group
@@ -79,7 +79,7 @@ class AzureContainerInstanceHook(AzureBaseHook):
def get_messages(self, resource_group: str, name: str) -> list:
"""
- Get the messages of a container group
+ Get the messages of a container group.
:param resource_group: the name of the resource group
:param name: the name of the container group
@@ -96,7 +96,7 @@ class AzureContainerInstanceHook(AzureBaseHook):
def get_state(self, resource_group: str, name: str) -> ContainerGroup:
"""
- Get the state of a container group
+ Get the state of a container group.
:param resource_group: the name of the resource group
:param name: the name of the container group
@@ -106,7 +106,7 @@ class AzureContainerInstanceHook(AzureBaseHook):
def get_logs(self, resource_group: str, name: str, tail: int = 1000) ->
list:
"""
- Get the tail from logs of a container group
+ Get the tail from logs of a container group.
:param resource_group: the name of the resource group
:param name: the name of the container group
@@ -118,7 +118,7 @@ class AzureContainerInstanceHook(AzureBaseHook):
def delete(self, resource_group: str, name: str) -> None:
"""
- Delete a container group
+ Delete a container group.
:param resource_group: the name of the resource group
:param name: the name of the container group
@@ -127,7 +127,7 @@ class AzureContainerInstanceHook(AzureBaseHook):
def exists(self, resource_group: str, name: str) -> bool:
"""
- Test if a container group exists
+ Test if a container group exists.
:param resource_group: the name of the resource group
:param name: the name of the container group
diff --git a/airflow/providers/microsoft/azure/hooks/container_registry.py
b/airflow/providers/microsoft/azure/hooks/container_registry.py
index 785cf1a529..a3298117cc 100644
--- a/airflow/providers/microsoft/azure/hooks/container_registry.py
+++ b/airflow/providers/microsoft/azure/hooks/container_registry.py
@@ -15,7 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-"""Hook for Azure Container Registry"""
+"""Hook for Azure Container Registry."""
from __future__ import annotations
from typing import Any
@@ -41,7 +41,7 @@ class AzureContainerRegistryHook(BaseHook):
@staticmethod
def get_ui_field_behaviour() -> dict[str, Any]:
- """Returns custom field behaviour"""
+ """Returns custom field behaviour."""
return {
"hidden_fields": ["schema", "port", "extra"],
"relabeling": {
diff --git a/airflow/providers/microsoft/azure/hooks/container_volume.py
b/airflow/providers/microsoft/azure/hooks/container_volume.py
index beaa6f9e2f..a40f4d4249 100644
--- a/airflow/providers/microsoft/azure/hooks/container_volume.py
+++ b/airflow/providers/microsoft/azure/hooks/container_volume.py
@@ -53,7 +53,7 @@ class AzureContainerVolumeHook(BaseHook):
@staticmethod
def get_connection_form_widgets() -> dict[str, Any]:
- """Returns connection widgets to add to connection form"""
+ """Returns connection widgets to add to connection form."""
from flask_appbuilder.fieldwidgets import BS3PasswordFieldWidget
from flask_babel import lazy_gettext
from wtforms import PasswordField
@@ -67,7 +67,7 @@ class AzureContainerVolumeHook(BaseHook):
@staticmethod
@_ensure_prefixes(conn_type="azure_container_volume")
def get_ui_field_behaviour() -> dict[str, Any]:
- """Returns custom field behaviour"""
+ """Returns custom field behaviour."""
return {
"hidden_fields": ["schema", "port", "host", "extra"],
"relabeling": {
@@ -82,7 +82,7 @@ class AzureContainerVolumeHook(BaseHook):
}
def get_storagekey(self) -> str:
- """Get Azure File Volume storage key"""
+ """Get Azure File Volume storage key."""
conn = self.get_connection(self.conn_id)
extras = conn.extra_dejson
connection_string = self._get_field(extras, "connection_string")
@@ -96,7 +96,7 @@ class AzureContainerVolumeHook(BaseHook):
def get_file_volume(
self, mount_name: str, share_name: str, storage_account_name: str,
read_only: bool = False
) -> Volume:
- """Get Azure File Volume"""
+ """Get Azure File Volume."""
return Volume(
name=mount_name,
azure_file=AzureFileVolume(
diff --git a/airflow/providers/microsoft/azure/hooks/cosmos.py
b/airflow/providers/microsoft/azure/hooks/cosmos.py
index b2d63a4a72..238abc4c70 100644
--- a/airflow/providers/microsoft/azure/hooks/cosmos.py
+++ b/airflow/providers/microsoft/azure/hooks/cosmos.py
@@ -56,7 +56,7 @@ class AzureCosmosDBHook(BaseHook):
@staticmethod
def get_connection_form_widgets() -> dict[str, Any]:
- """Returns connection widgets to add to connection form"""
+ """Returns connection widgets to add to connection form."""
from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
from flask_babel import lazy_gettext
from wtforms import StringField
@@ -73,7 +73,7 @@ class AzureCosmosDBHook(BaseHook):
@staticmethod
@_ensure_prefixes(conn_type="azure_cosmos") # todo: remove when min
airflow version >= 2.5
def get_ui_field_behaviour() -> dict[str, Any]:
- """Returns custom field behaviour"""
+ """Returns custom field behaviour."""
return {
"hidden_fields": ["schema", "port", "host", "extra"],
"relabeling": {
@@ -357,15 +357,15 @@ class AzureCosmosDBHook(BaseHook):
def get_database_link(database_id: str) -> str:
- """Get Azure CosmosDB database link"""
+ """Get Azure CosmosDB database link."""
return "dbs/" + database_id
def get_collection_link(database_id: str, collection_id: str) -> str:
- """Get Azure CosmosDB collection link"""
+ """Get Azure CosmosDB collection link."""
return get_database_link(database_id) + "/colls/" + collection_id
def get_document_link(database_id: str, collection_id: str, document_id: str)
-> str:
- """Get Azure CosmosDB document link"""
+ """Get Azure CosmosDB document link."""
return get_collection_link(database_id, collection_id) + "/docs/" +
document_id
diff --git a/airflow/providers/microsoft/azure/hooks/data_factory.py
b/airflow/providers/microsoft/azure/hooks/data_factory.py
index 7022354395..c74482a279 100644
--- a/airflow/providers/microsoft/azure/hooks/data_factory.py
+++ b/airflow/providers/microsoft/azure/hooks/data_factory.py
@@ -14,9 +14,9 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-"""
-.. spelling::
+"""Spelling exceptions.
+.. spelling::
CreateRunResponse
DatasetResource
LinkedServiceResource
@@ -157,7 +157,7 @@ class AzureDataFactoryHook(BaseHook):
@staticmethod
def get_connection_form_widgets() -> dict[str, Any]:
- """Returns connection widgets to add to connection form"""
+ """Returns connection widgets to add to connection form."""
from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
from flask_babel import lazy_gettext
from wtforms import StringField
@@ -173,7 +173,7 @@ class AzureDataFactoryHook(BaseHook):
@staticmethod
def get_ui_field_behaviour() -> dict[str, Any]:
- """Returns custom field behaviour"""
+ """Returns custom field behaviour."""
return {
"hidden_fields": ["schema", "port", "host", "extra"],
"relabeling": {
@@ -1088,7 +1088,7 @@ def provide_targeted_factory_async(func: T) -> T:
class AzureDataFactoryAsyncHook(AzureDataFactoryHook):
"""
- An Async Hook that connects to Azure DataFactory to perform pipeline
operations
+ An Async Hook that connects to Azure DataFactory to perform pipeline
operations.
:param azure_data_factory_conn_id: The :ref:`Azure Data Factory connection
id<howto/connection:adf>`.
"""
@@ -1101,7 +1101,7 @@ class AzureDataFactoryAsyncHook(AzureDataFactoryHook):
super().__init__(azure_data_factory_conn_id=azure_data_factory_conn_id)
async def get_async_conn(self) -> AsyncDataFactoryManagementClient:
- """Get async connection and connect to azure data factory"""
+ """Get async connection and connect to azure data factory."""
if self._async_conn is not None:
return self._async_conn
@@ -1141,7 +1141,7 @@ class AzureDataFactoryAsyncHook(AzureDataFactoryHook):
**config: Any,
) -> PipelineRun:
"""
- Connect to Azure Data Factory asynchronously to get the pipeline run
details by run id
+ Connect to Azure Data Factory asynchronously to get the pipeline run
details by run id.
:param run_id: The pipeline run identifier.
:param resource_group_name: The resource group name.
@@ -1159,7 +1159,7 @@ class AzureDataFactoryAsyncHook(AzureDataFactoryHook):
self, run_id: str, resource_group_name: str | None = None,
factory_name: str | None = None
) -> str:
"""
- Connect to Azure Data Factory asynchronously and get the pipeline
status by run_id
+ Connect to Azure Data Factory asynchronously and get the pipeline
status by run_id.
:param run_id: The pipeline run identifier.
:param resource_group_name: The resource group name.
diff --git a/airflow/providers/microsoft/azure/hooks/data_lake.py
b/airflow/providers/microsoft/azure/hooks/data_lake.py
index d143452b00..d153f60758 100644
--- a/airflow/providers/microsoft/azure/hooks/data_lake.py
+++ b/airflow/providers/microsoft/azure/hooks/data_lake.py
@@ -61,7 +61,7 @@ class AzureDataLakeHook(BaseHook):
@staticmethod
def get_connection_form_widgets() -> dict[str, Any]:
- """Returns connection widgets to add to connection form"""
+ """Returns connection widgets to add to connection form."""
from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
from flask_babel import lazy_gettext
from wtforms import StringField
@@ -76,7 +76,7 @@ class AzureDataLakeHook(BaseHook):
@staticmethod
@_ensure_prefixes(conn_type="azure_data_lake")
def get_ui_field_behaviour() -> dict[str, Any]:
- """Returns custom field behaviour"""
+ """Returns custom field behaviour."""
return {
"hidden_fields": ["schema", "port", "host", "extra"],
"relabeling": {
@@ -215,7 +215,7 @@ class AzureDataLakeHook(BaseHook):
def list(self, path: str) -> list:
"""
- List files in Azure Data Lake Storage
+ List files in Azure Data Lake Storage.
:param path: full path/globstring to use to list files in ADLS
"""
@@ -226,7 +226,7 @@ class AzureDataLakeHook(BaseHook):
def remove(self, path: str, recursive: bool = False, ignore_not_found:
bool = True) -> None:
"""
- Remove files in Azure Data Lake Storage
+ Remove files in Azure Data Lake Storage.
:param path: A directory or file to remove in ADLS
:param recursive: Whether to loop into directories in the location and
remove the files
@@ -245,7 +245,7 @@ class AzureDataLakeStorageV2Hook(BaseHook):
"""
This Hook interacts with ADLS gen2 storage account it mainly helps to
create and manage
directories and files in storage accounts that have a hierarchical
namespace. Using Adls_v2 connection
- details create DataLakeServiceClient object
+ details create DataLakeServiceClient object.
Due to Wasb is marked as legacy and and retirement of the (ADLS1) it would
be nice to
implement ADLS gen2 hook for interacting with the storage account.
@@ -264,7 +264,7 @@ class AzureDataLakeStorageV2Hook(BaseHook):
@staticmethod
def get_connection_form_widgets() -> dict[str, Any]:
- """Returns connection widgets to add to connection form"""
+ """Returns connection widgets to add to connection form."""
from flask_appbuilder.fieldwidgets import BS3PasswordFieldWidget,
BS3TextFieldWidget
from flask_babel import lazy_gettext
from wtforms import PasswordField, StringField
@@ -280,7 +280,7 @@ class AzureDataLakeStorageV2Hook(BaseHook):
@staticmethod
def get_ui_field_behaviour() -> dict[str, Any]:
- """Returns custom field behaviour"""
+ """Returns custom field behaviour."""
return {
"hidden_fields": ["schema", "port"],
"relabeling": {
@@ -361,7 +361,7 @@ class AzureDataLakeStorageV2Hook(BaseHook):
def get_file_system(self, file_system: FileSystemProperties | str) ->
FileSystemClient:
"""
- Get a client to interact with the specified file system
+ Get a client to interact with the specified file system.
:param file_system: This can either be the name of the file system
or an instance of FileSystemProperties.
@@ -414,7 +414,7 @@ class AzureDataLakeStorageV2Hook(BaseHook):
def create_file(self, file_system_name: FileSystemProperties | str,
file_name: str) -> DataLakeFileClient:
"""
- Creates a file under the file system
+ Creates a file under the file system.
:param file_system_name: Name of the file system or instance of
FileSystemProperties.
:param file_name: Name of the file which needs to be created in the
file system.
@@ -431,7 +431,7 @@ class AzureDataLakeStorageV2Hook(BaseHook):
**kwargs: Any,
) -> None:
"""
- Create a file with data in the file system
+ Create a file with data in the file system.
:param file_system_name: Name of the file system or instance of
FileSystemProperties.
:param file_name: Name of the file to be created with name.
@@ -453,7 +453,7 @@ class AzureDataLakeStorageV2Hook(BaseHook):
) -> None:
"""
Create a new file and return the file client to be interacted with and
then
- upload data to a file
+ upload data to a file.
:param file_system_name: Name of the file system or instance of
FileSystemProperties.
:param directory_name: Name of the directory.
@@ -470,7 +470,7 @@ class AzureDataLakeStorageV2Hook(BaseHook):
self, file_system_name: FileSystemProperties | str, directory_name: str
) -> list[str]:
"""
- Get the list of files or directories under the specified file system
+ Get the list of files or directories under the specified file system.
:param file_system_name: Name of the file system or instance of
FileSystemProperties.
:param directory_name: Name of the directory.
@@ -503,7 +503,7 @@ class AzureDataLakeStorageV2Hook(BaseHook):
def delete_file_system(self, file_system_name: FileSystemProperties | str)
-> None:
"""
- Deletes the file system
+ Deletes the file system.
:param file_system_name: Name of the file system or instance of
FileSystemProperties.
"""
@@ -518,7 +518,7 @@ class AzureDataLakeStorageV2Hook(BaseHook):
def delete_directory(self, file_system_name: FileSystemProperties | str,
directory_name: str) -> None:
"""
- Deletes specified directory in file system
+ Deletes specified directory in file system.
:param file_system_name: Name of the file system or instance of
FileSystemProperties.
:param directory_name: Name of the directory.
diff --git a/airflow/providers/microsoft/azure/hooks/fileshare.py
b/airflow/providers/microsoft/azure/hooks/fileshare.py
index c3b9cd907d..8067907706 100644
--- a/airflow/providers/microsoft/azure/hooks/fileshare.py
+++ b/airflow/providers/microsoft/azure/hooks/fileshare.py
@@ -76,7 +76,7 @@ class AzureFileShareHook(BaseHook):
@staticmethod
def get_connection_form_widgets() -> dict[str, Any]:
- """Returns connection widgets to add to connection form"""
+ """Returns connection widgets to add to connection form."""
from flask_appbuilder.fieldwidgets import BS3PasswordFieldWidget,
BS3TextFieldWidget
from flask_babel import lazy_gettext
from wtforms import PasswordField, StringField
@@ -94,7 +94,7 @@ class AzureFileShareHook(BaseHook):
@staticmethod
@_ensure_prefixes(conn_type="azure_fileshare")
def get_ui_field_behaviour() -> dict[str, Any]:
- """Returns custom field behaviour"""
+ """Returns custom field behaviour."""
return {
"hidden_fields": ["schema", "port", "host", "extra"],
"relabeling": {
diff --git a/airflow/providers/microsoft/azure/hooks/synapse.py
b/airflow/providers/microsoft/azure/hooks/synapse.py
index 8d1aed2afb..881f918b60 100644
--- a/airflow/providers/microsoft/azure/hooks/synapse.py
+++ b/airflow/providers/microsoft/azure/hooks/synapse.py
@@ -62,7 +62,7 @@ class AzureSynapseHook(BaseHook):
@staticmethod
def get_connection_form_widgets() -> dict[str, Any]:
- """Returns connection widgets to add to connection form"""
+ """Returns connection widgets to add to connection form."""
from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
from flask_babel import lazy_gettext
from wtforms import StringField
@@ -74,7 +74,7 @@ class AzureSynapseHook(BaseHook):
@staticmethod
def get_ui_field_behaviour() -> dict[str, Any]:
- """Returns custom field behaviour"""
+ """Returns custom field behaviour."""
return {
"hidden_fields": ["schema", "port", "extra"],
"relabeling": {"login": "Client ID", "password": "Secret", "host":
"Synapse Workspace URL"},
diff --git a/airflow/providers/microsoft/azure/hooks/wasb.py
b/airflow/providers/microsoft/azure/hooks/wasb.py
index 1c5b7d8b3e..916801cea8 100644
--- a/airflow/providers/microsoft/azure/hooks/wasb.py
+++ b/airflow/providers/microsoft/azure/hooks/wasb.py
@@ -103,7 +103,7 @@ class WasbHook(BaseHook):
@staticmethod
def get_connection_form_widgets() -> dict[str, Any]:
- """Returns connection widgets to add to connection form"""
+ """Returns connection widgets to add to connection form."""
from flask_appbuilder.fieldwidgets import BS3PasswordFieldWidget,
BS3TextFieldWidget
from flask_babel import lazy_gettext
from wtforms import PasswordField, StringField
@@ -124,7 +124,7 @@ class WasbHook(BaseHook):
@staticmethod
@_ensure_prefixes(conn_type="wasb")
def get_ui_field_behaviour() -> dict[str, Any]:
- """Returns custom field behaviour"""
+ """Returns custom field behaviour."""
return {
"hidden_fields": ["schema", "port", "extra"],
"relabeling": {
@@ -221,7 +221,7 @@ class WasbHook(BaseHook):
def _get_container_client(self, container_name: str) -> ContainerClient:
"""
- Instantiates a container client
+ Instantiates a container client.
:param container_name: The name of the container
:return: ContainerClient
@@ -230,7 +230,7 @@ class WasbHook(BaseHook):
def _get_blob_client(self, container_name: str, blob_name: str) ->
BlobClient:
"""
- Instantiates a blob client
+ Instantiates a blob client.
:param container_name: The name of the blob container
:param blob_name: The name of the blob. This needs not be existing
@@ -273,7 +273,7 @@ class WasbHook(BaseHook):
**kwargs,
) -> list:
"""
- List blobs in a given container
+ List blobs in a given container.
:param container_name: The name of the container
:param prefix: Filters the results to return only blobs whose names
@@ -400,7 +400,7 @@ class WasbHook(BaseHook):
self, container_name, blob_name, offset: int | None = None, length:
int | None = None, **kwargs
) -> StorageStreamDownloader:
"""
- Downloads a blob to the StorageStreamDownloader
+ Downloads a blob to the StorageStreamDownloader.
:param container_name: The name of the container containing the blob
:param blob_name: The name of the blob to download
@@ -413,7 +413,7 @@ class WasbHook(BaseHook):
def create_container(self, container_name: str) -> None:
"""
- Create container object if not already existing
+ Create container object if not already existing.
:param container_name: The name of the container to create
"""
@@ -444,7 +444,7 @@ class WasbHook(BaseHook):
def delete_container(self, container_name: str) -> None:
"""
- Delete a container object
+ Delete a container object.
:param container_name: The name of the container
"""
diff --git a/airflow/providers/microsoft/azure/log/wasb_task_handler.py
b/airflow/providers/microsoft/azure/log/wasb_task_handler.py
index c2bde81abc..51c0c4dc18 100644
--- a/airflow/providers/microsoft/azure/log/wasb_task_handler.py
+++ b/airflow/providers/microsoft/azure/log/wasb_task_handler.py
@@ -32,7 +32,8 @@ from airflow.utils.log.logging_mixin import LoggingMixin
def get_default_delete_local_copy():
- """Load delete_local_logs conf if Airflow version > 2.6 and return False
if not
+ """Load delete_local_logs conf if Airflow version > 2.6 and return False
if not.
+
TODO: delete this function when min airflow version >= 2.6
"""
from airflow.version import version
@@ -192,7 +193,7 @@ class WasbTaskHandler(FileTaskHandler, LoggingMixin):
def wasb_log_exists(self, remote_log_location: str) -> bool:
"""
- Check if remote_log_location exists in remote storage
+ Check if remote_log_location exists in remote storage.
:param remote_log_location: log's location in remote storage
:return: True if location exists else False
diff --git a/airflow/providers/microsoft/azure/operators/adls.py
b/airflow/providers/microsoft/azure/operators/adls.py
index 7d738ea53c..dd642d4f70 100644
--- a/airflow/providers/microsoft/azure/operators/adls.py
+++ b/airflow/providers/microsoft/azure/operators/adls.py
@@ -64,7 +64,7 @@ class ADLSDeleteOperator(BaseOperator):
class ADLSListOperator(BaseOperator):
"""
- List all files from the specified path
+ List all files from the specified path.
This operator returns a python list with the names of files which can be
used by
`xcom` in the downstream tasks.
diff --git a/airflow/providers/microsoft/azure/operators/adx.py
b/airflow/providers/microsoft/azure/operators/adx.py
index 1578451fcb..49813b6a0b 100644
--- a/airflow/providers/microsoft/azure/operators/adx.py
+++ b/airflow/providers/microsoft/azure/operators/adx.py
@@ -15,7 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-"""This module contains Azure Data Explorer operators"""
+"""This module contains Azure Data Explorer operators."""
from __future__ import annotations
from typing import TYPE_CHECKING, Sequence
@@ -62,14 +62,16 @@ class AzureDataExplorerQueryOperator(BaseOperator):
self.azure_data_explorer_conn_id = azure_data_explorer_conn_id
def get_hook(self) -> AzureDataExplorerHook:
- """Returns new instance of AzureDataExplorerHook"""
+ """Returns new instance of AzureDataExplorerHook."""
return AzureDataExplorerHook(self.azure_data_explorer_conn_id)
def execute(self, context: Context) -> KustoResultTable | str:
"""
Run KQL Query on Azure Data Explorer (Kusto).
- Returns `PrimaryResult` of Query v2 HTTP response contents
- (https://docs.microsoft.com/en-us/azure/kusto/api/rest/response2)
+
+ Returns `PrimaryResult` of Query v2 HTTP response contents.
+
+ https://docs.microsoft.com/en-us/azure/kusto/api/rest/response2
"""
hook = self.get_hook()
response = hook.run_query(self.query, self.database, self.options)
diff --git a/airflow/providers/microsoft/azure/operators/asb.py
b/airflow/providers/microsoft/azure/operators/asb.py
index ccb8678a0d..4110e62eb6 100644
--- a/airflow/providers/microsoft/azure/operators/asb.py
+++ b/airflow/providers/microsoft/azure/operators/asb.py
@@ -30,7 +30,7 @@ if TYPE_CHECKING:
class AzureServiceBusCreateQueueOperator(BaseOperator):
"""
- Creates a Azure Service Bus queue under a Service Bus Namespace by using
ServiceBusAdministrationClient
+ Creates a Azure Service Bus queue under a Service Bus Namespace by using
ServiceBusAdministrationClient.
.. seealso::
For more information on how to use this operator, take a look at the
guide:
@@ -68,7 +68,7 @@ class AzureServiceBusCreateQueueOperator(BaseOperator):
self.azure_service_bus_conn_id = azure_service_bus_conn_id
def execute(self, context: Context) -> None:
- """Creates Queue in Azure Service Bus namespace, by connecting to
Service Bus Admin client in hook"""
+ """Creates Queue in Azure Service Bus namespace, by connecting to
Service Bus Admin client in hook."""
hook =
AdminClientHook(azure_service_bus_conn_id=self.azure_service_bus_conn_id)
# create queue with name
@@ -83,7 +83,7 @@ class AzureServiceBusCreateQueueOperator(BaseOperator):
class AzureServiceBusSendMessageOperator(BaseOperator):
"""
- Send Message or batch message to the Service Bus queue
+ Send Message or batch message to the Service Bus queue.
.. seealso::
For more information on how to use this operator, take a look at the
guide:
@@ -118,7 +118,7 @@ class AzureServiceBusSendMessageOperator(BaseOperator):
def execute(self, context: Context) -> None:
"""
Sends Message to the specific queue in Service Bus namespace, by
- connecting to Service Bus client
+ connecting to Service Bus client.
"""
# Create the hook
hook =
MessageHook(azure_service_bus_conn_id=self.azure_service_bus_conn_id)
@@ -129,7 +129,7 @@ class AzureServiceBusSendMessageOperator(BaseOperator):
class AzureServiceBusReceiveMessageOperator(BaseOperator):
"""
- Receive a batch of messages at once in a specified Queue name
+ Receive a batch of messages at once in a specified Queue name.
.. seealso::
For more information on how to use this operator, take a look at the
guide:
@@ -163,7 +163,7 @@ class AzureServiceBusReceiveMessageOperator(BaseOperator):
def execute(self, context: Context) -> None:
"""
Receive Message in specific queue in Service Bus namespace,
- by connecting to Service Bus client
+ by connecting to Service Bus client.
"""
# Create the hook
hook =
MessageHook(azure_service_bus_conn_id=self.azure_service_bus_conn_id)
@@ -176,7 +176,7 @@ class AzureServiceBusReceiveMessageOperator(BaseOperator):
class AzureServiceBusDeleteQueueOperator(BaseOperator):
"""
- Deletes the Queue in the Azure Service Bus namespace
+ Deletes the Queue in the Azure Service Bus namespace.
.. seealso::
For more information on how to use this operator, take a look at the
guide:
@@ -202,7 +202,7 @@ class AzureServiceBusDeleteQueueOperator(BaseOperator):
self.azure_service_bus_conn_id = azure_service_bus_conn_id
def execute(self, context: Context) -> None:
- """Delete Queue in Service Bus namespace, by connecting to Service Bus
Admin client"""
+ """Delete Queue in Service Bus namespace, by connecting to Service Bus
Admin client."""
# Create the hook
hook =
AdminClientHook(azure_service_bus_conn_id=self.azure_service_bus_conn_id)
@@ -212,7 +212,7 @@ class AzureServiceBusDeleteQueueOperator(BaseOperator):
class AzureServiceBusTopicCreateOperator(BaseOperator):
"""
- Create an Azure Service Bus Topic under a Service Bus Namespace by using
ServiceBusAdministrationClient
+ Create an Azure Service Bus Topic under a Service Bus Namespace by using
ServiceBusAdministrationClient.
.. seealso::
For more information on how to use this operator, take a look at the
guide:
@@ -296,7 +296,7 @@ class AzureServiceBusTopicCreateOperator(BaseOperator):
self.max_message_size_in_kilobytes = max_message_size_in_kilobytes
def execute(self, context: Context) -> str:
- """Creates Topic in Service Bus namespace, by connecting to Service
Bus Admin client"""
+ """Creates Topic in Service Bus namespace, by connecting to Service
Bus Admin client."""
if self.topic_name is None:
raise TypeError("Topic name cannot be None.")
@@ -332,7 +332,7 @@ class AzureServiceBusTopicCreateOperator(BaseOperator):
class AzureServiceBusSubscriptionCreateOperator(BaseOperator):
"""
Create an Azure Service Bus Topic Subscription under a Service Bus
Namespace
- by using ServiceBusAdministrationClient
+ by using ServiceBusAdministrationClient.
.. seealso::
For more information on how to use this operator, take a look at the
guide:
@@ -409,7 +409,7 @@ class
AzureServiceBusSubscriptionCreateOperator(BaseOperator):
self.azure_service_bus_conn_id = azure_service_bus_conn_id
def execute(self, context: Context) -> None:
- """Creates Subscription in Service Bus namespace, by connecting to
Service Bus Admin client"""
+ """Creates Subscription in Service Bus namespace, by connecting to
Service Bus Admin client."""
if self.subscription_name is None:
raise TypeError("Subscription name cannot be None.")
if self.topic_name is None:
@@ -440,7 +440,7 @@ class
AzureServiceBusSubscriptionCreateOperator(BaseOperator):
class AzureServiceBusUpdateSubscriptionOperator(BaseOperator):
"""
Update an Azure ServiceBus Topic Subscription under a ServiceBus Namespace
- by using ServiceBusAdministrationClient
+ by using ServiceBusAdministrationClient.
.. seealso::
For more information on how to use this operator, take a look at the
guide:
@@ -481,7 +481,7 @@ class
AzureServiceBusUpdateSubscriptionOperator(BaseOperator):
self.azure_service_bus_conn_id = azure_service_bus_conn_id
def execute(self, context: Context) -> None:
- """Updates Subscription properties, by connecting to Service Bus Admin
client"""
+ """Updates Subscription properties, by connecting to Service Bus Admin
client."""
hook =
AdminClientHook(azure_service_bus_conn_id=self.azure_service_bus_conn_id)
with hook.get_conn() as service_mgmt_conn:
@@ -542,7 +542,7 @@ class ASBReceiveSubscriptionMessageOperator(BaseOperator):
def execute(self, context: Context) -> None:
"""
Receive Message in specific queue in Service Bus namespace,
- by connecting to Service Bus client
+ by connecting to Service Bus client.
"""
# Create the hook
hook =
MessageHook(azure_service_bus_conn_id=self.azure_service_bus_conn_id)
@@ -555,7 +555,7 @@ class ASBReceiveSubscriptionMessageOperator(BaseOperator):
class AzureServiceBusSubscriptionDeleteOperator(BaseOperator):
"""
- Deletes the topic subscription in the Azure ServiceBus namespace
+ Deletes the topic subscription in the Azure ServiceBus namespace.
.. seealso::
For more information on how to use this operator, take a look at the
guide:
@@ -584,7 +584,7 @@ class
AzureServiceBusSubscriptionDeleteOperator(BaseOperator):
self.azure_service_bus_conn_id = azure_service_bus_conn_id
def execute(self, context: Context) -> None:
- """Delete topic subscription in Service Bus namespace, by connecting
to Service Bus Admin client"""
+ """Delete topic subscription in Service Bus namespace, by connecting
to Service Bus Admin client."""
# Create the hook
hook =
AdminClientHook(azure_service_bus_conn_id=self.azure_service_bus_conn_id)
@@ -594,7 +594,7 @@ class
AzureServiceBusSubscriptionDeleteOperator(BaseOperator):
class AzureServiceBusTopicDeleteOperator(BaseOperator):
"""
- Deletes the topic in the Azure Service Bus namespace
+ Deletes the topic in the Azure Service Bus namespace.
.. seealso::
For more information on how to use this operator, take a look at the
guide:
@@ -620,7 +620,7 @@ class AzureServiceBusTopicDeleteOperator(BaseOperator):
self.azure_service_bus_conn_id = azure_service_bus_conn_id
def execute(self, context: Context) -> None:
- """Delete topic in Service Bus namespace, by connecting to Service Bus
Admin client"""
+ """Delete topic in Service Bus namespace, by connecting to Service Bus
Admin client."""
if self.topic_name is None:
raise TypeError("Topic name cannot be None.")
hook =
AdminClientHook(azure_service_bus_conn_id=self.azure_service_bus_conn_id)
diff --git a/airflow/providers/microsoft/azure/operators/batch.py
b/airflow/providers/microsoft/azure/operators/batch.py
index 0a14993c58..bb93c3b5ad 100644
--- a/airflow/providers/microsoft/azure/operators/batch.py
+++ b/airflow/providers/microsoft/azure/operators/batch.py
@@ -31,7 +31,7 @@ if TYPE_CHECKING:
class AzureBatchOperator(BaseOperator):
"""
- Executes a job on Azure Batch Service
+ Executes a job on Azure Batch Service.
:param batch_pool_id: A string that uniquely identifies the Pool within
the Account.
:param batch_pool_vm_size: The size of virtual machines in the Pool
@@ -316,7 +316,7 @@ class AzureBatchOperator(BaseOperator):
def clean_up(self, pool_id: str | None = None, job_id: str | None = None)
-> None:
"""
- Delete the given pool and job in the batch account
+ Delete the given pool and job in the batch account.
:param pool_id: The id of the pool to delete
:param job_id: The id of the job to delete
diff --git a/airflow/providers/microsoft/azure/operators/container_instances.py
b/airflow/providers/microsoft/azure/operators/container_instances.py
index 68b1cc57ba..8b5fba26cd 100644
--- a/airflow/providers/microsoft/azure/operators/container_instances.py
+++ b/airflow/providers/microsoft/azure/operators/container_instances.py
@@ -60,7 +60,7 @@ DEFAULT_CPU = 1.0
class AzureContainerInstancesOperator(BaseOperator):
"""
- Start a container on Azure Container Instances
+ Start a container on Azure Container Instances.
:param ci_conn_id: connection id of a service principal which will be used
to start the container instance
diff --git a/airflow/providers/microsoft/azure/operators/cosmos.py
b/airflow/providers/microsoft/azure/operators/cosmos.py
index 674a852053..08ffc9316b 100644
--- a/airflow/providers/microsoft/azure/operators/cosmos.py
+++ b/airflow/providers/microsoft/azure/operators/cosmos.py
@@ -29,7 +29,7 @@ if TYPE_CHECKING:
class AzureCosmosInsertDocumentOperator(BaseOperator):
"""
Inserts a new document into the specified Cosmos database and collection
- It will create both the database and collection if they do not already
exist
+ It will create both the database and collection if they do not already
exist.
:param database_name: The name of the database. (templated)
:param collection_name: The name of the collection. (templated)
diff --git a/airflow/providers/microsoft/azure/secrets/key_vault.py
b/airflow/providers/microsoft/azure/secrets/key_vault.py
index 34b78b5031..df696b0582 100644
--- a/airflow/providers/microsoft/azure/secrets/key_vault.py
+++ b/airflow/providers/microsoft/azure/secrets/key_vault.py
@@ -107,7 +107,7 @@ class AzureKeyVaultBackend(BaseSecretsBackend,
LoggingMixin):
def get_conn_value(self, conn_id: str) -> str | None:
"""
- Get a serialized representation of Airflow Connection from an Azure
Key Vault secret
+ Get a serialized representation of Airflow Connection from an Azure
Key Vault secret.
:param conn_id: The Airflow connection id to retrieve
"""
@@ -148,7 +148,7 @@ class AzureKeyVaultBackend(BaseSecretsBackend,
LoggingMixin):
def get_config(self, key: str) -> str | None:
"""
- Get Airflow Configuration
+ Get Airflow Configuration.
:param key: Configuration Option Key
:return: Configuration Option Value
@@ -178,7 +178,7 @@ class AzureKeyVaultBackend(BaseSecretsBackend,
LoggingMixin):
def _get_secret(self, path_prefix: str, secret_id: str) -> str | None:
"""
- Get an Azure Key Vault secret value
+ Get an Azure Key Vault secret value.
:param path_prefix: Prefix for the Path to get Secret
:param secret_id: Secret Key
diff --git a/airflow/providers/microsoft/azure/sensors/cosmos.py
b/airflow/providers/microsoft/azure/sensors/cosmos.py
index 2692b9ed86..9e31e1b999 100644
--- a/airflow/providers/microsoft/azure/sensors/cosmos.py
+++ b/airflow/providers/microsoft/azure/sensors/cosmos.py
@@ -28,10 +28,9 @@ if TYPE_CHECKING:
class AzureCosmosDocumentSensor(BaseSensorOperator):
"""
- Checks for the existence of a document which
- matches the given query in CosmosDB. Example:
+ Checks for the existence of a document which matches the given query in
CosmosDB.
- .. code-block::
+ .. code-block:: python
azure_cosmos_sensor = AzureCosmosDocumentSensor(
database_name="somedatabase_name",
diff --git a/airflow/providers/microsoft/azure/sensors/data_factory.py
b/airflow/providers/microsoft/azure/sensors/data_factory.py
index d5d9f23bcc..8ad28ee7a7 100644
--- a/airflow/providers/microsoft/azure/sensors/data_factory.py
+++ b/airflow/providers/microsoft/azure/sensors/data_factory.py
@@ -89,7 +89,7 @@ class
AzureDataFactoryPipelineRunStatusSensor(BaseSensorOperator):
def execute(self, context: Context) -> None:
"""Defers trigger class to poll for state of the job run until
- it reaches a failure state or success state
+ it reaches a failure state or success state.
"""
if not self.deferrable:
super().execute(context=context)
diff --git a/airflow/providers/microsoft/azure/sensors/wasb.py
b/airflow/providers/microsoft/azure/sensors/wasb.py
index db64255804..bc75ba341e 100644
--- a/airflow/providers/microsoft/azure/sensors/wasb.py
+++ b/airflow/providers/microsoft/azure/sensors/wasb.py
@@ -73,7 +73,7 @@ class WasbBlobSensor(BaseSensorOperator):
def execute(self, context: Context) -> None:
"""Defers trigger class to poll for state of the job run until
- it reaches a failure state or success state
+ it reaches a failure state or success state.
"""
if not self.deferrable:
super().execute(context=context)
@@ -168,7 +168,7 @@ class WasbPrefixSensor(BaseSensorOperator):
def execute(self, context: Context) -> None:
"""Defers trigger class to poll for state of the job run until it
- reaches a failure state or success state
+ reaches a failure state or success state.
"""
if not self.deferrable:
super().execute(context=context)
diff --git a/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py
b/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py
index 77bb6c4d48..05c3350a7a 100644
--- a/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py
+++ b/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py
@@ -30,7 +30,7 @@ if TYPE_CHECKING:
class AzureBlobStorageToGCSOperator(BaseOperator):
"""
- Operator transfers data from Azure Blob Storage to specified bucket in
Google Cloud Storage
+ Operator transfers data from Azure Blob Storage to specified bucket in
Google Cloud Storage.
.. seealso::
For more information on how to use this operator, take a look at the
guide:
diff --git a/airflow/providers/microsoft/azure/transfers/local_to_adls.py
b/airflow/providers/microsoft/azure/transfers/local_to_adls.py
index c155e84830..f39f837c98 100644
--- a/airflow/providers/microsoft/azure/transfers/local_to_adls.py
+++ b/airflow/providers/microsoft/azure/transfers/local_to_adls.py
@@ -29,7 +29,7 @@ if TYPE_CHECKING:
class LocalFilesystemToADLSOperator(BaseOperator):
"""
- Upload file(s) to Azure Data Lake
+ Upload file(s) to Azure Data Lake.
.. seealso::
For more information on how to use this operator, take a look at the
guide:
diff --git a/airflow/providers/microsoft/azure/transfers/sftp_to_wasb.py
b/airflow/providers/microsoft/azure/transfers/sftp_to_wasb.py
index 37d642036c..4d35c6ab9c 100644
--- a/airflow/providers/microsoft/azure/transfers/sftp_to_wasb.py
+++ b/airflow/providers/microsoft/azure/transfers/sftp_to_wasb.py
@@ -134,7 +134,7 @@ class SFTPToWasbOperator(BaseOperator):
return sftp_files
def get_tree_behavior(self) -> tuple[str, str | None, str | None]:
- """Extracts from source path the tree behavior to interact with the
remote folder"""
+ """Extracts from source path the tree behavior to interact with the
remote folder."""
self.check_wildcards_limit()
if self.source_path_contains_wildcard:
@@ -167,7 +167,7 @@ class SFTPToWasbOperator(BaseOperator):
return SFTPHook(self.sftp_conn_id)
def get_full_path_blob(self, file: str) -> str:
- """Get a blob name based on the previous name and a blob_prefix
variable"""
+ """Get a blob name based on the previous name and a blob_prefix
variable."""
return self.blob_prefix + os.path.basename(file)
def copy_files_to_wasb(self, sftp_files: list[SftpFile]) -> list[str]:
diff --git a/airflow/providers/microsoft/azure/triggers/data_factory.py
b/airflow/providers/microsoft/azure/triggers/data_factory.py
index c4c02ee9ff..10cf532847 100644
--- a/airflow/providers/microsoft/azure/triggers/data_factory.py
+++ b/airflow/providers/microsoft/azure/triggers/data_factory.py
@@ -30,7 +30,7 @@ from airflow.triggers.base import BaseTrigger, TriggerEvent
class ADFPipelineRunStatusSensorTrigger(BaseTrigger):
"""
ADFPipelineRunStatusSensorTrigger is fired as deferred class with params
to run the
- task in trigger worker, when ADF Pipeline is running
+ task in trigger worker, when ADF Pipeline is running.
:param run_id: The pipeline run identifier.
:param azure_data_factory_conn_id: The connection identifier for
connecting to Azure Data Factory.
@@ -68,7 +68,7 @@ class ADFPipelineRunStatusSensorTrigger(BaseTrigger):
)
async def run(self) -> AsyncIterator[TriggerEvent]:
- """Make async connection to Azure Data Factory, polls for the pipeline
run status"""
+ """Make async connection to Azure Data Factory, polls for the pipeline
run status."""
hook =
AzureDataFactoryAsyncHook(azure_data_factory_conn_id=self.azure_data_factory_conn_id)
try:
while True:
@@ -95,7 +95,7 @@ class ADFPipelineRunStatusSensorTrigger(BaseTrigger):
class AzureDataFactoryTrigger(BaseTrigger):
"""
AzureDataFactoryTrigger is triggered when Azure data factory pipeline job
succeeded or failed.
- When wait_for_termination is set to False it triggered immediately with
success status
+ When wait_for_termination is set to False it triggered immediately with
success status.
:param run_id: Run id of a Azure data pipeline run job.
:param azure_data_factory_conn_id: The connection identifier for
connecting to Azure Data Factory.
@@ -141,7 +141,7 @@ class AzureDataFactoryTrigger(BaseTrigger):
)
async def run(self) -> AsyncIterator[TriggerEvent]:
- """Make async connection to Azure Data Factory, polls for the pipeline
run status"""
+ """Make async connection to Azure Data Factory, polls for the pipeline
run status."""
hook =
AzureDataFactoryAsyncHook(azure_data_factory_conn_id=self.azure_data_factory_conn_id)
try:
pipeline_status = await hook.get_adf_pipeline_run_status(
diff --git a/airflow/providers/microsoft/mssql/hooks/mssql.py
b/airflow/providers/microsoft/mssql/hooks/mssql.py
index d6d6209526..56bca7a8b9 100644
--- a/airflow/providers/microsoft/mssql/hooks/mssql.py
+++ b/airflow/providers/microsoft/mssql/hooks/mssql.py
@@ -15,7 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-"""Microsoft SQLServer hook module"""
+"""Microsoft SQLServer hook module."""
from __future__ import annotations
from typing import Any
@@ -86,12 +86,12 @@ class MsSqlHook(DbApiHook):
def get_sqlalchemy_connection(
self, connect_kwargs: dict | None = None, engine_kwargs: dict | None =
None
) -> Any:
- """Sqlalchemy connection object"""
+ """Sqlalchemy connection object."""
engine = self.get_sqlalchemy_engine(engine_kwargs=engine_kwargs)
return engine.connect(**(connect_kwargs or {}))
def get_conn(self) -> pymssql.connect:
- """Returns a mssql connection object"""
+ """Returns a mssql connection object."""
conn = self.get_connection(self.mssql_conn_id) # type:
ignore[attr-defined]
conn = pymssql.connect(
diff --git a/airflow/providers/microsoft/mssql/operators/mssql.py
b/airflow/providers/microsoft/mssql/operators/mssql.py
index c9ef577c65..043162f3eb 100644
--- a/airflow/providers/microsoft/mssql/operators/mssql.py
+++ b/airflow/providers/microsoft/mssql/operators/mssql.py
@@ -26,7 +26,7 @@ from airflow.providers.common.sql.operators.sql import
SQLExecuteQueryOperator
class MsSqlOperator(SQLExecuteQueryOperator):
"""
- Executes sql code in a specific Microsoft SQL database
+ Executes sql code in a specific Microsoft SQL database.
.. seealso::
For more information on how to use this operator, take a look at the
guide: