From 6a1ab8141bb5826628d3f6f884c0544619540516 Mon Sep 17 00:00:00 2001 From: Jacob Lauzon Date: Mon, 8 Dec 2025 17:18:51 -0800 Subject: [PATCH 1/2] Adjust default connection_data_block_size for all Storage packages --- .../azure/storage/blob/_shared/base_client.py | 10 +++++++++- .../azure/storage/blob/_shared/base_client_async.py | 10 +++++++++- .../azure/storage/blob/_shared/constants.py | 3 ++- .../azure/storage/filedatalake/_shared/base_client.py | 10 +++++++++- .../storage/filedatalake/_shared/base_client_async.py | 10 +++++++++- .../azure/storage/filedatalake/_shared/constants.py | 3 ++- .../azure/storage/fileshare/_shared/base_client.py | 10 +++++++++- .../storage/fileshare/_shared/base_client_async.py | 10 +++++++++- .../azure/storage/fileshare/_shared/constants.py | 3 ++- .../azure/storage/queue/_shared/base_client.py | 10 +++++++++- .../azure/storage/queue/_shared/base_client_async.py | 10 +++++++++- .../azure/storage/queue/_shared/constants.py | 3 ++- 12 files changed, 80 insertions(+), 12 deletions(-) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py index dbb3b369c6d2..0d90d0abf4e5 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py @@ -35,7 +35,14 @@ ) from .authentication import SharedKeyCredentialPolicy -from .constants import CONNECTION_TIMEOUT, DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, STORAGE_OAUTH_SCOPE +from .constants import ( + CONNECTION_TIMEOUT, + DATA_BLOCK_SIZE, + DEFAULT_OAUTH_SCOPE, + READ_TIMEOUT, + SERVICE_HOST_BASE, + STORAGE_OAUTH_SCOPE +) from .models import LocationMode, StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint from .policies import ( @@ -268,6 +275,7 @@ def _create_pipeline( transport = kwargs.get("transport") kwargs.setdefault("connection_timeout", CONNECTION_TIMEOUT) kwargs.setdefault("read_timeout", READ_TIMEOUT) + kwargs.setdefault("connection_data_block_size", DATA_BLOCK_SIZE) if not transport: transport = RequestsTransport(**kwargs) policies = [ diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py index d77258b3b426..9bbc294c8f02 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py @@ -24,7 +24,14 @@ from .authentication import SharedKeyCredentialPolicy from .base_client import create_configuration -from .constants import CONNECTION_TIMEOUT, DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, STORAGE_OAUTH_SCOPE +from .constants import ( + CONNECTION_TIMEOUT, + DATA_BLOCK_SIZE, + DEFAULT_OAUTH_SCOPE, + READ_TIMEOUT, + SERVICE_HOST_BASE, + STORAGE_OAUTH_SCOPE +) from .models import StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint from .policies import ( @@ -109,6 +116,7 @@ def _create_pipeline( transport = kwargs.get("transport") kwargs.setdefault("connection_timeout", CONNECTION_TIMEOUT) kwargs.setdefault("read_timeout", READ_TIMEOUT) + kwargs.setdefault("connection_data_block_size", DATA_BLOCK_SIZE) if not transport: try: from azure.core.pipeline.transport import ( # pylint: disable=non-abstract-transport-import diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/constants.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/constants.py index 0926f04c4081..50c760369faa 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/constants.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/constants.py @@ -9,9 +9,10 @@ X_MS_VERSION = _SUPPORTED_API_VERSIONS[-1] -# Default socket timeouts, in seconds +# Connection defaults CONNECTION_TIMEOUT = 20 READ_TIMEOUT = 60 +DATA_BLOCK_SIZE = 256 * 1024 DEFAULT_OAUTH_SCOPE = "/.default" STORAGE_OAUTH_SCOPE = "https://storage.azure.com/.default" diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py index dbb3b369c6d2..0d90d0abf4e5 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py @@ -35,7 +35,14 @@ ) from .authentication import SharedKeyCredentialPolicy -from .constants import CONNECTION_TIMEOUT, DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, STORAGE_OAUTH_SCOPE +from .constants import ( + CONNECTION_TIMEOUT, + DATA_BLOCK_SIZE, + DEFAULT_OAUTH_SCOPE, + READ_TIMEOUT, + SERVICE_HOST_BASE, + STORAGE_OAUTH_SCOPE +) from .models import LocationMode, StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint from .policies import ( @@ -268,6 +275,7 @@ def _create_pipeline( transport = kwargs.get("transport") kwargs.setdefault("connection_timeout", CONNECTION_TIMEOUT) kwargs.setdefault("read_timeout", READ_TIMEOUT) + kwargs.setdefault("connection_data_block_size", DATA_BLOCK_SIZE) if not transport: transport = RequestsTransport(**kwargs) policies = [ diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client_async.py index d77258b3b426..9bbc294c8f02 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client_async.py @@ -24,7 +24,14 @@ from .authentication import SharedKeyCredentialPolicy from .base_client import create_configuration -from .constants import CONNECTION_TIMEOUT, DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, STORAGE_OAUTH_SCOPE +from .constants import ( + CONNECTION_TIMEOUT, + DATA_BLOCK_SIZE, + DEFAULT_OAUTH_SCOPE, + READ_TIMEOUT, + SERVICE_HOST_BASE, + STORAGE_OAUTH_SCOPE +) from .models import StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint from .policies import ( @@ -109,6 +116,7 @@ def _create_pipeline( transport = kwargs.get("transport") kwargs.setdefault("connection_timeout", CONNECTION_TIMEOUT) kwargs.setdefault("read_timeout", READ_TIMEOUT) + kwargs.setdefault("connection_data_block_size", DATA_BLOCK_SIZE) if not transport: try: from azure.core.pipeline.transport import ( # pylint: disable=non-abstract-transport-import diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/constants.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/constants.py index 0926f04c4081..50c760369faa 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/constants.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/constants.py @@ -9,9 +9,10 @@ X_MS_VERSION = _SUPPORTED_API_VERSIONS[-1] -# Default socket timeouts, in seconds +# Connection defaults CONNECTION_TIMEOUT = 20 READ_TIMEOUT = 60 +DATA_BLOCK_SIZE = 256 * 1024 DEFAULT_OAUTH_SCOPE = "/.default" STORAGE_OAUTH_SCOPE = "https://storage.azure.com/.default" diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py index dbb3b369c6d2..0d90d0abf4e5 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py @@ -35,7 +35,14 @@ ) from .authentication import SharedKeyCredentialPolicy -from .constants import CONNECTION_TIMEOUT, DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, STORAGE_OAUTH_SCOPE +from .constants import ( + CONNECTION_TIMEOUT, + DATA_BLOCK_SIZE, + DEFAULT_OAUTH_SCOPE, + READ_TIMEOUT, + SERVICE_HOST_BASE, + STORAGE_OAUTH_SCOPE +) from .models import LocationMode, StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint from .policies import ( @@ -268,6 +275,7 @@ def _create_pipeline( transport = kwargs.get("transport") kwargs.setdefault("connection_timeout", CONNECTION_TIMEOUT) kwargs.setdefault("read_timeout", READ_TIMEOUT) + kwargs.setdefault("connection_data_block_size", DATA_BLOCK_SIZE) if not transport: transport = RequestsTransport(**kwargs) policies = [ diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client_async.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client_async.py index d77258b3b426..9bbc294c8f02 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client_async.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client_async.py @@ -24,7 +24,14 @@ from .authentication import SharedKeyCredentialPolicy from .base_client import create_configuration -from .constants import CONNECTION_TIMEOUT, DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, STORAGE_OAUTH_SCOPE +from .constants import ( + CONNECTION_TIMEOUT, + DATA_BLOCK_SIZE, + DEFAULT_OAUTH_SCOPE, + READ_TIMEOUT, + SERVICE_HOST_BASE, + STORAGE_OAUTH_SCOPE +) from .models import StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint from .policies import ( @@ -109,6 +116,7 @@ def _create_pipeline( transport = kwargs.get("transport") kwargs.setdefault("connection_timeout", CONNECTION_TIMEOUT) kwargs.setdefault("read_timeout", READ_TIMEOUT) + kwargs.setdefault("connection_data_block_size", DATA_BLOCK_SIZE) if not transport: try: from azure.core.pipeline.transport import ( # pylint: disable=non-abstract-transport-import diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/constants.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/constants.py index 0926f04c4081..50c760369faa 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/constants.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/constants.py @@ -9,9 +9,10 @@ X_MS_VERSION = _SUPPORTED_API_VERSIONS[-1] -# Default socket timeouts, in seconds +# Connection defaults CONNECTION_TIMEOUT = 20 READ_TIMEOUT = 60 +DATA_BLOCK_SIZE = 256 * 1024 DEFAULT_OAUTH_SCOPE = "/.default" STORAGE_OAUTH_SCOPE = "https://storage.azure.com/.default" diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py index 9a5ab430bf8f..de7561c1bd99 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py @@ -35,7 +35,14 @@ ) from .authentication import SharedKeyCredentialPolicy -from .constants import CONNECTION_TIMEOUT, DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, STORAGE_OAUTH_SCOPE +from .constants import ( + CONNECTION_TIMEOUT, + DATA_BLOCK_SIZE, + DEFAULT_OAUTH_SCOPE, + READ_TIMEOUT, + SERVICE_HOST_BASE, + STORAGE_OAUTH_SCOPE +) from .models import LocationMode, StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint from .policies import ( @@ -268,6 +275,7 @@ def _create_pipeline( transport = kwargs.get("transport") kwargs.setdefault("connection_timeout", CONNECTION_TIMEOUT) kwargs.setdefault("read_timeout", READ_TIMEOUT) + kwargs.setdefault("connection_data_block_size", DATA_BLOCK_SIZE) if not transport: transport = RequestsTransport(**kwargs) policies = [ diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py index 6fff66b5a920..111e7f200c1f 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py @@ -24,7 +24,14 @@ from .authentication import SharedKeyCredentialPolicy from .base_client import create_configuration -from .constants import CONNECTION_TIMEOUT, DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, STORAGE_OAUTH_SCOPE +from .constants import ( + CONNECTION_TIMEOUT, + DATA_BLOCK_SIZE, + DEFAULT_OAUTH_SCOPE, + READ_TIMEOUT, + SERVICE_HOST_BASE, + STORAGE_OAUTH_SCOPE +) from .models import StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint from .policies import ( @@ -109,6 +116,7 @@ def _create_pipeline( transport = kwargs.get("transport") kwargs.setdefault("connection_timeout", CONNECTION_TIMEOUT) kwargs.setdefault("read_timeout", READ_TIMEOUT) + kwargs.setdefault("connection_data_block_size", DATA_BLOCK_SIZE) if not transport: try: from azure.core.pipeline.transport import ( # pylint: disable=non-abstract-transport-import diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/constants.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/constants.py index 0926f04c4081..50c760369faa 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/constants.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/constants.py @@ -9,9 +9,10 @@ X_MS_VERSION = _SUPPORTED_API_VERSIONS[-1] -# Default socket timeouts, in seconds +# Connection defaults CONNECTION_TIMEOUT = 20 READ_TIMEOUT = 60 +DATA_BLOCK_SIZE = 256 * 1024 DEFAULT_OAUTH_SCOPE = "/.default" STORAGE_OAUTH_SCOPE = "https://storage.azure.com/.default" From 24df7e4576880214b55148a885c267b5de0e18ec Mon Sep 17 00:00:00 2001 From: Jacob Lauzon Date: Tue, 9 Dec 2025 11:30:35 -0800 Subject: [PATCH 2/2] Black --- .../azure/storage/blob/_shared/base_client.py | 2 +- .../azure/storage/blob/_shared/base_client_async.py | 2 +- .../azure/storage/filedatalake/_shared/base_client.py | 2 +- .../azure/storage/filedatalake/_shared/base_client_async.py | 2 +- .../azure/storage/fileshare/_shared/base_client.py | 2 +- .../azure/storage/fileshare/_shared/base_client_async.py | 2 +- .../azure/storage/queue/_shared/base_client.py | 2 +- .../azure/storage/queue/_shared/base_client_async.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py index 0d90d0abf4e5..5441488d86a9 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py @@ -41,7 +41,7 @@ DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, - STORAGE_OAUTH_SCOPE + STORAGE_OAUTH_SCOPE, ) from .models import LocationMode, StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py index 9bbc294c8f02..16aba3116029 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py @@ -30,7 +30,7 @@ DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, - STORAGE_OAUTH_SCOPE + STORAGE_OAUTH_SCOPE, ) from .models import StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py index 0d90d0abf4e5..5441488d86a9 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py @@ -41,7 +41,7 @@ DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, - STORAGE_OAUTH_SCOPE + STORAGE_OAUTH_SCOPE, ) from .models import LocationMode, StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client_async.py index 9bbc294c8f02..16aba3116029 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client_async.py @@ -30,7 +30,7 @@ DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, - STORAGE_OAUTH_SCOPE + STORAGE_OAUTH_SCOPE, ) from .models import StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py index 0d90d0abf4e5..5441488d86a9 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py @@ -41,7 +41,7 @@ DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, - STORAGE_OAUTH_SCOPE + STORAGE_OAUTH_SCOPE, ) from .models import LocationMode, StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client_async.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client_async.py index 9bbc294c8f02..16aba3116029 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client_async.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client_async.py @@ -30,7 +30,7 @@ DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, - STORAGE_OAUTH_SCOPE + STORAGE_OAUTH_SCOPE, ) from .models import StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py index de7561c1bd99..3f7609b9f026 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py @@ -41,7 +41,7 @@ DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, - STORAGE_OAUTH_SCOPE + STORAGE_OAUTH_SCOPE, ) from .models import LocationMode, StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py index 111e7f200c1f..400f7d6f6dff 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py @@ -30,7 +30,7 @@ DEFAULT_OAUTH_SCOPE, READ_TIMEOUT, SERVICE_HOST_BASE, - STORAGE_OAUTH_SCOPE + STORAGE_OAUTH_SCOPE, ) from .models import StorageConfiguration from .parser import DEVSTORE_ACCOUNT_KEY, _get_development_storage_endpoint