azure-storage-blob 12.24.0b1__py3-none-any.whl → 12.25.0b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. azure/storage/blob/_blob_client.py +6 -3
  2. azure/storage/blob/_download.py +2 -2
  3. azure/storage/blob/_generated/__init__.py +9 -3
  4. azure/storage/blob/_generated/_configuration.py +1 -1
  5. azure/storage/blob/_generated/_patch.py +16 -29
  6. azure/storage/blob/_generated/_serialization.py +52 -117
  7. azure/storage/blob/_generated/aio/__init__.py +9 -3
  8. azure/storage/blob/_generated/aio/_configuration.py +1 -1
  9. azure/storage/blob/_generated/aio/_patch.py +16 -29
  10. azure/storage/blob/_generated/aio/operations/__init__.py +14 -8
  11. azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +17 -15
  12. azure/storage/blob/_generated/aio/operations/_blob_operations.py +55 -52
  13. azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +21 -18
  14. azure/storage/blob/_generated/aio/operations/_container_operations.py +41 -38
  15. azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +26 -23
  16. azure/storage/blob/_generated/aio/operations/_patch.py +2 -8
  17. azure/storage/blob/_generated/aio/operations/_service_operations.py +19 -17
  18. azure/storage/blob/_generated/models/__init__.py +91 -80
  19. azure/storage/blob/_generated/models/_models_py3.py +4 -5
  20. azure/storage/blob/_generated/models/_patch.py +2 -8
  21. azure/storage/blob/_generated/operations/__init__.py +14 -8
  22. azure/storage/blob/_generated/operations/_append_blob_operations.py +14 -12
  23. azure/storage/blob/_generated/operations/_blob_operations.py +34 -32
  24. azure/storage/blob/_generated/operations/_block_blob_operations.py +16 -14
  25. azure/storage/blob/_generated/operations/_container_operations.py +28 -26
  26. azure/storage/blob/_generated/operations/_page_blob_operations.py +19 -17
  27. azure/storage/blob/_generated/operations/_patch.py +2 -8
  28. azure/storage/blob/_generated/operations/_service_operations.py +18 -16
  29. azure/storage/blob/_models.py +1 -1
  30. azure/storage/blob/_serialize.py +1 -0
  31. azure/storage/blob/_shared/authentication.py +1 -1
  32. azure/storage/blob/_shared/base_client.py +1 -1
  33. azure/storage/blob/_shared/parser.py +2 -10
  34. azure/storage/blob/_shared/policies_async.py +2 -2
  35. azure/storage/blob/_shared/request_handlers.py +3 -4
  36. azure/storage/blob/_shared/response_handlers.py +2 -2
  37. azure/storage/blob/_shared/shared_access_signature.py +2 -2
  38. azure/storage/blob/_version.py +1 -1
  39. azure/storage/blob/aio/_blob_client_async.py +6 -3
  40. azure/storage/blob/aio/_download_async.py +3 -3
  41. {azure_storage_blob-12.24.0b1.dist-info → azure_storage_blob-12.25.0b1.dist-info}/METADATA +20 -20
  42. {azure_storage_blob-12.24.0b1.dist-info → azure_storage_blob-12.25.0b1.dist-info}/RECORD +45 -45
  43. {azure_storage_blob-12.24.0b1.dist-info → azure_storage_blob-12.25.0b1.dist-info}/WHEEL +1 -1
  44. {azure_storage_blob-12.24.0b1.dist-info → azure_storage_blob-12.25.0b1.dist-info}/LICENSE +0 -0
  45. {azure_storage_blob-12.24.0b1.dist-info → azure_storage_blob-12.25.0b1.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- # pylint: disable=too-many-lines,too-many-statements
1
+ # pylint: disable=too-many-lines
2
2
  # coding=utf-8
3
3
  # --------------------------------------------------------------------------
4
4
  # Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,8 +8,9 @@
8
8
  # --------------------------------------------------------------------------
9
9
  import datetime
10
10
  import sys
11
- from typing import Any, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union
11
+ from typing import Any, Callable, Dict, IO, Literal, Optional, TypeVar, Union
12
12
 
13
+ from azure.core import PipelineClient
13
14
  from azure.core.exceptions import (
14
15
  ClientAuthenticationError,
15
16
  HttpResponseError,
@@ -24,12 +25,13 @@ from azure.core.tracing.decorator import distributed_trace
24
25
  from azure.core.utils import case_insensitive_dict
25
26
 
26
27
  from .. import models as _models
27
- from .._serialization import Serializer
28
+ from .._configuration import AzureBlobStorageConfiguration
29
+ from .._serialization import Deserializer, Serializer
28
30
 
29
31
  if sys.version_info >= (3, 9):
30
32
  from collections.abc import MutableMapping
31
33
  else:
32
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
34
+ from typing import MutableMapping # type: ignore
33
35
  T = TypeVar("T")
34
36
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
35
37
 
@@ -818,10 +820,10 @@ class PageBlobOperations:
818
820
 
819
821
  def __init__(self, *args, **kwargs):
820
822
  input_args = list(args)
821
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
822
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
823
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
824
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
823
+ self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
824
+ self._config: AzureBlobStorageConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
825
+ self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
826
+ self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
825
827
 
826
828
  @distributed_trace
827
829
  def create( # pylint: disable=inconsistent-return-statements
@@ -901,7 +903,7 @@ class PageBlobOperations:
901
903
  :rtype: None
902
904
  :raises ~azure.core.exceptions.HttpResponseError:
903
905
  """
904
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
906
+ error_map: MutableMapping = {
905
907
  401: ClientAuthenticationError,
906
908
  404: ResourceNotFoundError,
907
909
  409: ResourceExistsError,
@@ -1090,7 +1092,7 @@ class PageBlobOperations:
1090
1092
  :rtype: None
1091
1093
  :raises ~azure.core.exceptions.HttpResponseError:
1092
1094
  """
1093
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
1095
+ error_map: MutableMapping = {
1094
1096
  401: ClientAuthenticationError,
1095
1097
  404: ResourceNotFoundError,
1096
1098
  409: ResourceExistsError,
@@ -1263,7 +1265,7 @@ class PageBlobOperations:
1263
1265
  :rtype: None
1264
1266
  :raises ~azure.core.exceptions.HttpResponseError:
1265
1267
  """
1266
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
1268
+ error_map: MutableMapping = {
1267
1269
  401: ClientAuthenticationError,
1268
1270
  404: ResourceNotFoundError,
1269
1271
  409: ResourceExistsError,
@@ -1441,7 +1443,7 @@ class PageBlobOperations:
1441
1443
  :rtype: None
1442
1444
  :raises ~azure.core.exceptions.HttpResponseError:
1443
1445
  """
1444
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
1446
+ error_map: MutableMapping = {
1445
1447
  401: ClientAuthenticationError,
1446
1448
  404: ResourceNotFoundError,
1447
1449
  409: ResourceExistsError,
@@ -1629,7 +1631,7 @@ class PageBlobOperations:
1629
1631
  :rtype: ~azure.storage.blob.models.PageList
1630
1632
  :raises ~azure.core.exceptions.HttpResponseError:
1631
1633
  """
1632
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
1634
+ error_map: MutableMapping = {
1633
1635
  401: ClientAuthenticationError,
1634
1636
  404: ResourceNotFoundError,
1635
1637
  409: ResourceExistsError,
@@ -1781,7 +1783,7 @@ class PageBlobOperations:
1781
1783
  :rtype: ~azure.storage.blob.models.PageList
1782
1784
  :raises ~azure.core.exceptions.HttpResponseError:
1783
1785
  """
1784
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
1786
+ error_map: MutableMapping = {
1785
1787
  401: ClientAuthenticationError,
1786
1788
  404: ResourceNotFoundError,
1787
1789
  409: ResourceExistsError,
@@ -1904,7 +1906,7 @@ class PageBlobOperations:
1904
1906
  :rtype: None
1905
1907
  :raises ~azure.core.exceptions.HttpResponseError:
1906
1908
  """
1907
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
1909
+ error_map: MutableMapping = {
1908
1910
  401: ClientAuthenticationError,
1909
1911
  404: ResourceNotFoundError,
1910
1912
  409: ResourceExistsError,
@@ -2033,7 +2035,7 @@ class PageBlobOperations:
2033
2035
  :rtype: None
2034
2036
  :raises ~azure.core.exceptions.HttpResponseError:
2035
2037
  """
2036
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
2038
+ error_map: MutableMapping = {
2037
2039
  401: ClientAuthenticationError,
2038
2040
  404: ResourceNotFoundError,
2039
2041
  409: ResourceExistsError,
@@ -2145,7 +2147,7 @@ class PageBlobOperations:
2145
2147
  :rtype: None
2146
2148
  :raises ~azure.core.exceptions.HttpResponseError:
2147
2149
  """
2148
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
2150
+ error_map: MutableMapping = {
2149
2151
  401: ClientAuthenticationError,
2150
2152
  404: ResourceNotFoundError,
2151
2153
  409: ResourceExistsError,
@@ -2,19 +2,13 @@
2
2
  # Copyright (c) Microsoft Corporation.
3
3
  # Licensed under the MIT License.
4
4
  # ------------------------------------
5
-
6
-
7
5
  """Customize generated code here.
8
6
 
9
7
  Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
10
8
  """
11
- from typing import TYPE_CHECKING
12
-
13
- if TYPE_CHECKING:
14
- # pylint: disable=unused-import,ungrouped-imports
9
+ from typing import List
15
10
 
16
- from typing import List
17
- __all__ = [] # type: List[str] # Add all objects you want publicly available to users at this package level
11
+ __all__: List[str] = [] # Add all objects you want publicly available to users at this package level
18
12
 
19
13
 
20
14
  def patch_sdk():
@@ -1,4 +1,4 @@
1
- # pylint: disable=too-many-lines,too-many-statements
1
+ # pylint: disable=too-many-lines
2
2
  # coding=utf-8
3
3
  # --------------------------------------------------------------------------
4
4
  # Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,8 +7,9 @@
7
7
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
8
  # --------------------------------------------------------------------------
9
9
  import sys
10
- from typing import Any, Callable, Dict, IO, Iterator, List, Literal, Optional, Type, TypeVar, Union
10
+ from typing import Any, Callable, Dict, IO, Iterator, List, Literal, Optional, TypeVar, Union
11
11
 
12
+ from azure.core import PipelineClient
12
13
  from azure.core.exceptions import (
13
14
  ClientAuthenticationError,
14
15
  HttpResponseError,
@@ -25,12 +26,13 @@ from azure.core.tracing.decorator import distributed_trace
25
26
  from azure.core.utils import case_insensitive_dict
26
27
 
27
28
  from .. import models as _models
28
- from .._serialization import Serializer
29
+ from .._configuration import AzureBlobStorageConfiguration
30
+ from .._serialization import Deserializer, Serializer
29
31
 
30
32
  if sys.version_info >= (3, 9):
31
33
  from collections.abc import MutableMapping
32
34
  else:
33
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
35
+ from typing import MutableMapping # type: ignore
34
36
  T = TypeVar("T")
35
37
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
36
38
 
@@ -366,10 +368,10 @@ class ServiceOperations:
366
368
 
367
369
  def __init__(self, *args, **kwargs):
368
370
  input_args = list(args)
369
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
370
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
371
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
372
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
371
+ self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
372
+ self._config: AzureBlobStorageConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
373
+ self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
374
+ self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
373
375
 
374
376
  @distributed_trace
375
377
  def set_properties( # pylint: disable=inconsistent-return-statements
@@ -398,7 +400,7 @@ class ServiceOperations:
398
400
  :rtype: None
399
401
  :raises ~azure.core.exceptions.HttpResponseError:
400
402
  """
401
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
403
+ error_map: MutableMapping = {
402
404
  401: ClientAuthenticationError,
403
405
  404: ResourceNotFoundError,
404
406
  409: ResourceExistsError,
@@ -473,7 +475,7 @@ class ServiceOperations:
473
475
  :rtype: ~azure.storage.blob.models.StorageServiceProperties
474
476
  :raises ~azure.core.exceptions.HttpResponseError:
475
477
  """
476
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
478
+ error_map: MutableMapping = {
477
479
  401: ClientAuthenticationError,
478
480
  404: ResourceNotFoundError,
479
481
  409: ResourceExistsError,
@@ -548,7 +550,7 @@ class ServiceOperations:
548
550
  :rtype: ~azure.storage.blob.models.StorageServiceStats
549
551
  :raises ~azure.core.exceptions.HttpResponseError:
550
552
  """
551
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
553
+ error_map: MutableMapping = {
552
554
  401: ClientAuthenticationError,
553
555
  404: ResourceNotFoundError,
554
556
  409: ResourceExistsError,
@@ -650,7 +652,7 @@ class ServiceOperations:
650
652
  :rtype: ~azure.storage.blob.models.ListContainersSegmentResponse
651
653
  :raises ~azure.core.exceptions.HttpResponseError:
652
654
  """
653
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
655
+ error_map: MutableMapping = {
654
656
  401: ClientAuthenticationError,
655
657
  404: ResourceNotFoundError,
656
658
  409: ResourceExistsError,
@@ -732,7 +734,7 @@ class ServiceOperations:
732
734
  :rtype: ~azure.storage.blob.models.UserDelegationKey
733
735
  :raises ~azure.core.exceptions.HttpResponseError:
734
736
  """
735
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
737
+ error_map: MutableMapping = {
736
738
  401: ClientAuthenticationError,
737
739
  404: ResourceNotFoundError,
738
740
  409: ResourceExistsError,
@@ -811,7 +813,7 @@ class ServiceOperations:
811
813
  :rtype: None
812
814
  :raises ~azure.core.exceptions.HttpResponseError:
813
815
  """
814
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
816
+ error_map: MutableMapping = {
815
817
  401: ClientAuthenticationError,
816
818
  404: ResourceNotFoundError,
817
819
  409: ResourceExistsError,
@@ -893,7 +895,7 @@ class ServiceOperations:
893
895
  :rtype: Iterator[bytes]
894
896
  :raises ~azure.core.exceptions.HttpResponseError:
895
897
  """
896
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
898
+ error_map: MutableMapping = {
897
899
  401: ClientAuthenticationError,
898
900
  404: ResourceNotFoundError,
899
901
  409: ResourceExistsError,
@@ -1004,7 +1006,7 @@ class ServiceOperations:
1004
1006
  :rtype: ~azure.storage.blob.models.FilterBlobSegment
1005
1007
  :raises ~azure.core.exceptions.HttpResponseError:
1006
1008
  """
1007
- error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
1009
+ error_map: MutableMapping = {
1008
1010
  401: ClientAuthenticationError,
1009
1011
  404: ResourceNotFoundError,
1010
1012
  409: ResourceExistsError,
@@ -95,7 +95,7 @@ class PremiumPageBlobTier(str, Enum, metaclass=CaseInsensitiveEnumMeta):
95
95
  """
96
96
  Specifies the page blob tier to set the blob to. This is only applicable to page
97
97
  blobs on premium storage accounts. Please take a look at:
98
- https://docs.microsoft.com/en-us/azure/storage/storage-premium-storage#scalability-and-performance-targets
98
+ https://learn.microsoft.com/azure/storage/storage-premium-storage#scalability-and-performance-targets
99
99
  for detailed information on the corresponding IOPS and throughput per PageBlobTier.
100
100
  """
101
101
 
@@ -58,6 +58,7 @@ _SUPPORTED_API_VERSIONS = [
58
58
  '2024-08-04',
59
59
  '2024-11-04',
60
60
  '2025-01-05',
61
+ '2025-05-05',
61
62
  ]
62
63
 
63
64
 
@@ -121,7 +121,7 @@ class AzureSigningError(ClientAuthenticationError):
121
121
  """
122
122
  Represents a fatal error when attempting to sign a request.
123
123
  In general, the cause of this exception is user error. For example, the given account key is not valid.
124
- Please visit https://docs.microsoft.com/en-us/azure/storage/common/storage-create-storage-account for more info.
124
+ Please visit https://learn.microsoft.com/azure/storage/common/storage-create-storage-account for more info.
125
125
  """
126
126
 
127
127
 
@@ -363,7 +363,7 @@ class TransportWrapper(HttpTransport):
363
363
 
364
364
 
365
365
  def _format_shared_key_credential(
366
- account_name: str,
366
+ account_name: Optional[str],
367
367
  credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "AsyncTokenCredential", TokenCredential]] = None # pylint: disable=line-too-long
368
368
  ) -> Any:
369
369
  if isinstance(credential, str):
@@ -4,26 +4,17 @@
4
4
  # license information.
5
5
  # --------------------------------------------------------------------------
6
6
 
7
- import sys
8
7
  from datetime import datetime, timezone
9
8
  from typing import Optional
10
9
 
11
10
  EPOCH_AS_FILETIME = 116444736000000000 # January 1, 1970 as MS filetime
12
11
  HUNDREDS_OF_NANOSECONDS = 10000000
13
12
 
14
- if sys.version_info < (3,):
15
- def _str(value):
16
- if isinstance(value, unicode): # pylint: disable=undefined-variable
17
- return value.encode('utf-8')
18
-
19
- return str(value)
20
- else:
21
- _str = str
22
-
23
13
 
24
14
  def _to_utc_datetime(value: datetime) -> str:
25
15
  return value.strftime('%Y-%m-%dT%H:%M:%SZ')
26
16
 
17
+
27
18
  def _rfc_1123_to_datetime(rfc_1123: str) -> Optional[datetime]:
28
19
  """Converts an RFC 1123 date string to a UTC datetime.
29
20
 
@@ -36,6 +27,7 @@ def _rfc_1123_to_datetime(rfc_1123: str) -> Optional[datetime]:
36
27
 
37
28
  return datetime.strptime(rfc_1123, "%a, %d %b %Y %H:%M:%S %Z")
38
29
 
30
+
39
31
  def _filetime_to_datetime(filetime: str) -> Optional[datetime]:
40
32
  """Converts an MS filetime string to a UTC datetime. "0" indicates None.
41
33
  If parsing MS Filetime fails, tries RFC 1123 as backup.
@@ -46,11 +46,11 @@ async def is_checksum_retry(response):
46
46
  # retry if invalid content md5
47
47
  if response.context.get('validate_content', False) and response.http_response.headers.get('content-md5'):
48
48
  try:
49
- await response.http_response.read() # Load the body in memory and close the socket
49
+ await response.http_response.load_body() # Load the body in memory and close the socket
50
50
  except (StreamClosedError, StreamConsumedError):
51
51
  pass
52
52
  computed_md5 = response.http_request.headers.get('content-md5', None) or \
53
- encode_base64(StorageContentValidation.get_content_md5(response.http_response.content))
53
+ encode_base64(StorageContentValidation.get_content_md5(response.http_response.body()))
54
54
  if response.http_response.headers['content-md5'] != computed_md5:
55
55
  return True
56
56
  return False
@@ -4,12 +4,11 @@
4
4
  # license information.
5
5
  # --------------------------------------------------------------------------
6
6
 
7
- from typing import Dict, Optional
8
-
9
7
  import logging
10
- from os import fstat
11
8
  import stat
12
9
  from io import (SEEK_END, SEEK_SET, UnsupportedOperation)
10
+ from os import fstat
11
+ from typing import Dict, Optional
13
12
 
14
13
  import isodate
15
14
 
@@ -186,7 +185,7 @@ def serialize_batch_body(requests, batch_id):
186
185
  # final line of body MUST have \r\n at the end, or it will not be properly read by the service
187
186
  batch_body.append(newline_bytes)
188
187
 
189
- return bytes().join(batch_body)
188
+ return b"".join(batch_body)
190
189
 
191
190
 
192
191
  def _get_batch_request_delimiter(batch_id, is_prepend_dashes=False, is_append_dashes=False):
@@ -60,9 +60,9 @@ def normalize_headers(headers):
60
60
 
61
61
  def deserialize_metadata(response, obj, headers): # pylint: disable=unused-argument
62
62
  try:
63
- raw_metadata = {k: v for k, v in response.http_response.headers.items() if k.startswith("x-ms-meta-")}
63
+ raw_metadata = {k: v for k, v in response.http_response.headers.items() if k.lower().startswith('x-ms-meta-')}
64
64
  except AttributeError:
65
- raw_metadata = {k: v for k, v in response.headers.items() if k.startswith("x-ms-meta-")}
65
+ raw_metadata = {k: v for k, v in response.headers.items() if k.lower().startswith('x-ms-meta-')}
66
66
  return {k[10:]: v for k, v in raw_metadata.items()}
67
67
 
68
68
 
@@ -7,7 +7,7 @@
7
7
 
8
8
  from datetime import date
9
9
 
10
- from .parser import _str, _to_utc_datetime
10
+ from .parser import _to_utc_datetime
11
11
  from .constants import X_MS_VERSION
12
12
  from . import sign_string, url_quote
13
13
 
@@ -187,7 +187,7 @@ class _SharedAccessHelper(object):
187
187
 
188
188
  def _add_query(self, name, val):
189
189
  if val:
190
- self.query_dict[name] = _str(val) if val is not None else None
190
+ self.query_dict[name] = str(val) if val is not None else None
191
191
 
192
192
  def add_encryption_scope(self, **kwargs):
193
193
  self._add_query(QueryStringConstants.SIGNED_ENCRYPTION_SCOPE, kwargs.pop('encryption_scope', None))
@@ -4,4 +4,4 @@
4
4
  # license information.
5
5
  # --------------------------------------------------------------------------
6
6
 
7
- VERSION = "12.24.0b1"
7
+ VERSION = "12.25.0b1"
@@ -530,8 +530,9 @@ class BlobClient(AsyncStorageAccountHostsMixin, StorageAccountHostsMixin, Storag
530
530
  value specified in this header, the request will fail with
531
531
  MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed).
532
532
  :keyword int max_concurrency:
533
- Maximum number of parallel connections to use when the blob size exceeds
534
- 64MB.
533
+ Maximum number of parallel connections to use when transferring the blob in chunks.
534
+ This option does not affect the underlying connection pool, and may
535
+ require a separate configuration of the connection pool.
535
536
  :keyword ~azure.storage.blob.CustomerProvidedEncryptionKey cpk:
536
537
  Encrypts the data on the service-side with the given key.
537
538
  Use of customer-provided keys must be done over HTTPS.
@@ -687,7 +688,9 @@ class BlobClient(AsyncStorageAccountHostsMixin, StorageAccountHostsMixin, Storag
687
688
  As the encryption key itself is provided in the request,
688
689
  a secure connection must be established to transfer the key.
689
690
  :keyword int max_concurrency:
690
- The number of parallel connections with which to download.
691
+ Maximum number of parallel connections to use when transferring the blob in chunks.
692
+ This option does not affect the underlying connection pool, and may
693
+ require a separate configuration of the connection pool.
691
694
  :keyword str encoding:
692
695
  Encoding to decode the downloaded bytes. Default is None, i.e. no decoding.
693
696
  :keyword progress_hook:
@@ -46,8 +46,8 @@ T = TypeVar('T', bytes, str)
46
46
  async def process_content(data: Any, start_offset: int, end_offset: int, encryption: Dict[str, Any]) -> bytes:
47
47
  if data is None:
48
48
  raise ValueError("Response cannot be None.")
49
- await data.response.read()
50
- content = cast(bytes, data.response.content)
49
+ await data.response.load_body()
50
+ content = cast(bytes, data.response.body())
51
51
  if encryption.get('key') is not None or encryption.get('resolver') is not None:
52
52
  try:
53
53
  return decrypt_blob(
@@ -558,7 +558,7 @@ class StorageStreamDownloader(Generic[T]): # pylint: disable=too-many-instance-
558
558
  output_stream: Union[BytesIO, StringIO]
559
559
  if self._text_mode:
560
560
  output_stream = StringIO()
561
- size = chars if chars else sys.maxsize
561
+ size = sys.maxsize if chars is None or chars <= 0 else chars
562
562
  else:
563
563
  output_stream = BytesIO()
564
564
  size = size if size > 0 else sys.maxsize
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: azure-storage-blob
3
- Version: 12.24.0b1
3
+ Version: 12.25.0b1
4
4
  Summary: Microsoft Azure Blob Storage Client Library for Python
5
5
  Home-page: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
6
6
  Author: Microsoft Corporation
@@ -42,7 +42,7 @@ Blob storage is ideal for:
42
42
  | [Package (PyPI)](https://pypi.org/project/azure-storage-blob/)
43
43
  | [Package (Conda)](https://anaconda.org/microsoft/azure-storage/)
44
44
  | [API reference documentation](https://aka.ms/azsdk-python-storage-blob-ref)
45
- | [Product documentation](https://docs.microsoft.com/azure/storage/)
45
+ | [Product documentation](https://learn.microsoft.com/azure/storage/)
46
46
  | [Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob/samples)
47
47
 
48
48
 
@@ -51,7 +51,7 @@ Blob storage is ideal for:
51
51
  ### Prerequisites
52
52
  * Python 3.8 or later is required to use this package. For more details, please read our page on [Azure SDK for Python version support policy](https://github.com/Azure/azure-sdk-for-python/wiki/Azure-SDKs-Python-version-support-policy).
53
53
  * You must have an [Azure subscription](https://azure.microsoft.com/free/) and an
54
- [Azure storage account](https://docs.microsoft.com/azure/storage/common/storage-account-overview) to use this package.
54
+ [Azure storage account](https://learn.microsoft.com/azure/storage/common/storage-account-overview) to use this package.
55
55
 
56
56
  ### Install the package
57
57
  Install the Azure Storage Blobs client library for Python with [pip](https://pypi.org/project/pip/):
@@ -62,9 +62,9 @@ pip install azure-storage-blob
62
62
 
63
63
  ### Create a storage account
64
64
  If you wish to create a new storage account, you can use the
65
- [Azure Portal](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal),
66
- [Azure PowerShell](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell),
67
- or [Azure CLI](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli):
65
+ [Azure Portal](https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal),
66
+ [Azure PowerShell](https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell),
67
+ or [Azure CLI](https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli):
68
68
 
69
69
  ```bash
70
70
  # Create a new resource group to hold the storage account -
@@ -89,9 +89,9 @@ service = BlobServiceClient(account_url="https://<my-storage-account-name>.blob.
89
89
 
90
90
  #### Looking up the account URL
91
91
  You can find the storage account's blob service URL using the
92
- [Azure Portal](https://docs.microsoft.com/azure/storage/common/storage-account-overview#storage-account-endpoints),
93
- [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.storage/get-azstorageaccount),
94
- or [Azure CLI](https://docs.microsoft.com/cli/azure/storage/account?view=azure-cli-latest#az-storage-account-show):
92
+ [Azure Portal](https://learn.microsoft.com/azure/storage/common/storage-account-overview#storage-account-endpoints),
93
+ [Azure PowerShell](https://learn.microsoft.com/powershell/module/az.storage/get-azstorageaccount),
94
+ or [Azure CLI](https://learn.microsoft.com/cli/azure/storage/account?view=azure-cli-latest#az-storage-account-show):
95
95
 
96
96
  ```bash
97
97
  # Get the blob service account url for the storage account
@@ -100,8 +100,8 @@ az storage account show -n my-storage-account-name -g my-resource-group --query
100
100
 
101
101
  #### Types of credentials
102
102
  The `credential` parameter may be provided in a number of different forms, depending on the type of
103
- [authorization](https://docs.microsoft.com/azure/storage/common/storage-auth) you wish to use:
104
- 1. To use an [Azure Active Directory (AAD) token credential](https://docs.microsoft.com/azure/storage/common/storage-auth-aad),
103
+ [authorization](https://learn.microsoft.com/azure/storage/common/storage-auth) you wish to use:
104
+ 1. To use an [Azure Active Directory (AAD) token credential](https://learn.microsoft.com/azure/storage/common/storage-auth-aad),
105
105
  provide an instance of the desired credential type obtained from the
106
106
  [azure-identity](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials) library.
107
107
  For example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential)
@@ -109,8 +109,8 @@ The `credential` parameter may be provided in a number of different forms, depen
109
109
 
110
110
  This requires some initial setup:
111
111
  * [Install azure-identity](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#install-the-package)
112
- * [Register a new AAD application](https://docs.microsoft.com/azure/active-directory/develop/quickstart-register-app) and give permissions to access Azure Storage
113
- * [Grant access](https://docs.microsoft.com/azure/storage/common/storage-auth-aad-rbac-portal) to Azure Blob data with RBAC in the Azure Portal
112
+ * [Register a new AAD application](https://learn.microsoft.com/azure/active-directory/develop/quickstart-register-app) and give permissions to access Azure Storage
113
+ * [Grant access](https://learn.microsoft.com/azure/storage/common/storage-auth-aad-rbac-portal) to Azure Blob data with RBAC in the Azure Portal
114
114
  * Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
115
115
  AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET
116
116
 
@@ -126,7 +126,7 @@ The `credential` parameter may be provided in a number of different forms, depen
126
126
  )
127
127
  ```
128
128
 
129
- 2. To use a [shared access signature (SAS) token](https://docs.microsoft.com/azure/storage/common/storage-sas-overview),
129
+ 2. To use a [shared access signature (SAS) token](https://learn.microsoft.com/azure/storage/common/storage-sas-overview),
130
130
  provide the token as a string. If your account URL includes the SAS token, omit the credential parameter.
131
131
  You can generate a SAS token from the Azure Portal under "Shared access signature" or use one of the `generate_sas()`
132
132
  functions to create a sas token for the storage account, container, or blob:
@@ -146,7 +146,7 @@ The `credential` parameter may be provided in a number of different forms, depen
146
146
  blob_service_client = BlobServiceClient(account_url="https://<my_account_name>.blob.core.windows.net", credential=sas_token)
147
147
  ```
148
148
 
149
- 3. To use a storage account [shared key](https://docs.microsoft.com/rest/api/storageservices/authenticate-with-shared-key/)
149
+ 3. To use a storage account [shared key](https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key/)
150
150
  (aka account key or access key), provide the key as a string. This can be found in the Azure Portal under the "Access Keys"
151
151
  section or by running the following Azure CLI command:
152
152
 
@@ -166,7 +166,7 @@ The `credential` parameter may be provided in a number of different forms, depen
166
166
  credential={"account_name": "<your_account_name>", "account_key":"<account_access_key>"})
167
167
  ```
168
168
 
169
- 4. To use [anonymous public read access](https://docs.microsoft.com/azure/storage/blobs/storage-manage-access-to-resources),
169
+ 4. To use [anonymous public read access](https://learn.microsoft.com/azure/storage/blobs/storage-manage-access-to-resources),
170
170
  simply omit the credential parameter.
171
171
 
172
172
  #### Creating the client from a connection string
@@ -227,13 +227,13 @@ objects are async context managers and define async `close` methods.
227
227
 
228
228
  ### Blob Types
229
229
  Once you've initialized a Client, you can choose from the different types of blobs:
230
- * [Block blobs](https://docs.microsoft.com/rest/api/storageservices/understanding-block-blobs--append-blobs--and-page-blobs#about-block-blobs)
230
+ * [Block blobs](https://learn.microsoft.com/rest/api/storageservices/understanding-block-blobs--append-blobs--and-page-blobs#about-block-blobs)
231
231
  store text and binary data, up to approximately 4.75 TiB. Block blobs are made up of blocks of data that can be
232
232
  managed individually
233
- * [Append blobs](https://docs.microsoft.com/rest/api/storageservices/understanding-block-blobs--append-blobs--and-page-blobs#about-append-blobs)
233
+ * [Append blobs](https://learn.microsoft.com/rest/api/storageservices/understanding-block-blobs--append-blobs--and-page-blobs#about-append-blobs)
234
234
  are made up of blocks like block blobs, but are optimized for append operations. Append blobs are ideal for scenarios
235
235
  such as logging data from virtual machines
236
- * [Page blobs](https://docs.microsoft.com/rest/api/storageservices/understanding-block-blobs--append-blobs--and-page-blobs#about-page-blobs)
236
+ * [Page blobs](https://learn.microsoft.com/rest/api/storageservices/understanding-block-blobs--append-blobs--and-page-blobs#about-page-blobs)
237
237
  store random access files up to 8 TiB in size. Page blobs store virtual hard drive (VHD) files and serve as disks for
238
238
  Azure virtual machines
239
239
 
@@ -490,7 +490,7 @@ Several Storage Blobs Python SDK samples are available to you in the SDK's GitHu
490
490
  * Delete a single file or recursively delete a directory
491
491
 
492
492
  ### Additional documentation
493
- For more extensive documentation on Azure Blob storage, see the [Azure Blob storage documentation](https://docs.microsoft.com/azure/storage/blobs/) on docs.microsoft.com.
493
+ For more extensive documentation on Azure Blob storage, see the [Azure Blob storage documentation](https://learn.microsoft.com/azure/storage/blobs/) on learn.microsoft.com.
494
494
 
495
495
  ## Contributing
496
496
  This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.