azure-storage-blob 12.19.1__py3-none-any.whl → 12.20.0__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 (59) hide show
  1. azure/storage/blob/__init__.py +17 -5
  2. azure/storage/blob/_blob_client.py +23 -7
  3. azure/storage/blob/_blob_service_client.py +9 -3
  4. azure/storage/blob/_container_client.py +37 -13
  5. azure/storage/blob/_download.py +3 -3
  6. azure/storage/blob/_encryption.py +254 -165
  7. azure/storage/blob/_generated/_azure_blob_storage.py +21 -3
  8. azure/storage/blob/_generated/_configuration.py +4 -11
  9. azure/storage/blob/_generated/_serialization.py +41 -49
  10. azure/storage/blob/_generated/aio/_azure_blob_storage.py +23 -3
  11. azure/storage/blob/_generated/aio/_configuration.py +4 -11
  12. azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +24 -58
  13. azure/storage/blob/_generated/aio/operations/_blob_operations.py +123 -306
  14. azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +37 -86
  15. azure/storage/blob/_generated/aio/operations/_container_operations.py +98 -289
  16. azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +51 -150
  17. azure/storage/blob/_generated/aio/operations/_service_operations.py +49 -125
  18. azure/storage/blob/_generated/models/_models_py3.py +31 -31
  19. azure/storage/blob/_generated/operations/_append_blob_operations.py +25 -59
  20. azure/storage/blob/_generated/operations/_blob_operations.py +123 -306
  21. azure/storage/blob/_generated/operations/_block_blob_operations.py +39 -88
  22. azure/storage/blob/_generated/operations/_container_operations.py +100 -291
  23. azure/storage/blob/_generated/operations/_page_blob_operations.py +52 -151
  24. azure/storage/blob/_generated/operations/_service_operations.py +50 -126
  25. azure/storage/blob/_lease.py +1 -0
  26. azure/storage/blob/_models.py +3 -4
  27. azure/storage/blob/_serialize.py +1 -0
  28. azure/storage/blob/_shared/authentication.py +1 -1
  29. azure/storage/blob/_shared/avro/avro_io.py +0 -6
  30. azure/storage/blob/_shared/avro/avro_io_async.py +0 -6
  31. azure/storage/blob/_shared/avro/datafile.py +0 -4
  32. azure/storage/blob/_shared/avro/datafile_async.py +0 -4
  33. azure/storage/blob/_shared/avro/schema.py +4 -4
  34. azure/storage/blob/_shared/base_client.py +72 -87
  35. azure/storage/blob/_shared/base_client_async.py +115 -27
  36. azure/storage/blob/_shared/models.py +120 -27
  37. azure/storage/blob/_shared/parser.py +7 -6
  38. azure/storage/blob/_shared/policies.py +96 -66
  39. azure/storage/blob/_shared/policies_async.py +48 -21
  40. azure/storage/blob/_shared/response_handlers.py +14 -16
  41. azure/storage/blob/_shared/shared_access_signature.py +3 -3
  42. azure/storage/blob/_shared_access_signature.py +38 -27
  43. azure/storage/blob/_upload_helpers.py +4 -7
  44. azure/storage/blob/_version.py +1 -1
  45. azure/storage/blob/aio/__init__.py +13 -4
  46. azure/storage/blob/aio/_blob_client_async.py +17 -6
  47. azure/storage/blob/aio/_blob_service_client_async.py +4 -2
  48. azure/storage/blob/aio/_container_client_async.py +26 -9
  49. azure/storage/blob/aio/_download_async.py +9 -9
  50. azure/storage/blob/aio/_encryption_async.py +72 -0
  51. azure/storage/blob/aio/_lease_async.py +1 -1
  52. azure/storage/blob/aio/_upload_helpers.py +8 -10
  53. {azure_storage_blob-12.19.1.dist-info → azure_storage_blob-12.20.0.dist-info}/METADATA +10 -10
  54. azure_storage_blob-12.20.0.dist-info/RECORD +81 -0
  55. {azure_storage_blob-12.19.1.dist-info → azure_storage_blob-12.20.0.dist-info}/WHEEL +1 -1
  56. azure/storage/blob/_generated/py.typed +0 -1
  57. azure_storage_blob-12.19.1.dist-info/RECORD +0 -81
  58. {azure_storage_blob-12.19.1.dist-info → azure_storage_blob-12.20.0.dist-info}/LICENSE +0 -0
  59. {azure_storage_blob-12.19.1.dist-info → azure_storage_blob-12.20.0.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- # pylint: disable=too-many-lines
1
+ # pylint: disable=too-many-lines,too-many-statements
2
2
  # coding=utf-8
3
3
  # --------------------------------------------------------------------------
4
4
  # Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,8 +6,7 @@
6
6
  # Code generated by Microsoft (R) AutoRest Code Generator.
7
7
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
8
  # --------------------------------------------------------------------------
9
- import sys
10
- from typing import Any, Callable, Dict, IO, Iterator, List, Optional, TypeVar, Union
9
+ from typing import Any, Callable, Dict, IO, Iterator, List, Literal, Optional, TypeVar, Union
11
10
 
12
11
  from azure.core.exceptions import (
13
12
  ClientAuthenticationError,
@@ -27,10 +26,6 @@ from .. import models as _models
27
26
  from .._serialization import Serializer
28
27
  from .._vendor import _convert_request
29
28
 
30
- if sys.version_info >= (3, 8):
31
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
32
- else:
33
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
34
29
  T = TypeVar("T")
35
30
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
36
31
 
@@ -260,7 +255,7 @@ def build_submit_batch_request(
260
255
  url: str,
261
256
  *,
262
257
  content_length: int,
263
- content: IO,
258
+ content: IO[bytes],
264
259
  timeout: Optional[int] = None,
265
260
  request_id_parameter: Optional[str] = None,
266
261
  **kwargs: Any
@@ -387,13 +382,6 @@ class ServiceOperations:
387
382
  limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
388
383
  value is None.
389
384
  :type request_id_parameter: str
390
- :keyword restype: restype. Default value is "service". Note that overriding this default value
391
- may result in unsupported behavior.
392
- :paramtype restype: str
393
- :keyword comp: comp. Default value is "properties". Note that overriding this default value may
394
- result in unsupported behavior.
395
- :paramtype comp: str
396
- :keyword callable cls: A custom type or function that will be passed the direct response
397
385
  :return: None or the result of cls(response)
398
386
  :rtype: None
399
387
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -416,7 +404,7 @@ class ServiceOperations:
416
404
 
417
405
  _content = self._serialize.body(storage_service_properties, "StorageServiceProperties", is_xml=True)
418
406
 
419
- request = build_set_properties_request(
407
+ _request = build_set_properties_request(
420
408
  url=self._config.url,
421
409
  timeout=timeout,
422
410
  request_id_parameter=request_id_parameter,
@@ -425,16 +413,15 @@ class ServiceOperations:
425
413
  content_type=content_type,
426
414
  version=self._config.version,
427
415
  content=_content,
428
- template_url=self.set_properties.metadata["url"],
429
416
  headers=_headers,
430
417
  params=_params,
431
418
  )
432
- request = _convert_request(request)
433
- request.url = self._client.format_url(request.url)
419
+ _request = _convert_request(_request)
420
+ _request.url = self._client.format_url(_request.url)
434
421
 
435
422
  _stream = False
436
423
  pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
437
- request, stream=_stream, **kwargs
424
+ _request, stream=_stream, **kwargs
438
425
  )
439
426
 
440
427
  response = pipeline_response.http_response
@@ -452,9 +439,7 @@ class ServiceOperations:
452
439
  response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
453
440
 
454
441
  if cls:
455
- return cls(pipeline_response, None, response_headers)
456
-
457
- set_properties.metadata = {"url": "{url}"}
442
+ return cls(pipeline_response, None, response_headers) # type: ignore
458
443
 
459
444
  @distributed_trace
460
445
  def get_properties(
@@ -472,13 +457,6 @@ class ServiceOperations:
472
457
  limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
473
458
  value is None.
474
459
  :type request_id_parameter: str
475
- :keyword restype: restype. Default value is "service". Note that overriding this default value
476
- may result in unsupported behavior.
477
- :paramtype restype: str
478
- :keyword comp: comp. Default value is "properties". Note that overriding this default value may
479
- result in unsupported behavior.
480
- :paramtype comp: str
481
- :keyword callable cls: A custom type or function that will be passed the direct response
482
460
  :return: StorageServiceProperties or the result of cls(response)
483
461
  :rtype: ~azure.storage.blob.models.StorageServiceProperties
484
462
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -498,23 +476,22 @@ class ServiceOperations:
498
476
  comp: Literal["properties"] = kwargs.pop("comp", _params.pop("comp", "properties"))
499
477
  cls: ClsType[_models.StorageServiceProperties] = kwargs.pop("cls", None)
500
478
 
501
- request = build_get_properties_request(
479
+ _request = build_get_properties_request(
502
480
  url=self._config.url,
503
481
  timeout=timeout,
504
482
  request_id_parameter=request_id_parameter,
505
483
  restype=restype,
506
484
  comp=comp,
507
485
  version=self._config.version,
508
- template_url=self.get_properties.metadata["url"],
509
486
  headers=_headers,
510
487
  params=_params,
511
488
  )
512
- request = _convert_request(request)
513
- request.url = self._client.format_url(request.url)
489
+ _request = _convert_request(_request)
490
+ _request.url = self._client.format_url(_request.url)
514
491
 
515
492
  _stream = False
516
493
  pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
517
- request, stream=_stream, **kwargs
494
+ _request, stream=_stream, **kwargs
518
495
  )
519
496
 
520
497
  response = pipeline_response.http_response
@@ -534,11 +511,9 @@ class ServiceOperations:
534
511
  deserialized = self._deserialize("StorageServiceProperties", pipeline_response)
535
512
 
536
513
  if cls:
537
- return cls(pipeline_response, deserialized, response_headers)
538
-
539
- return deserialized
514
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
540
515
 
541
- get_properties.metadata = {"url": "{url}"}
516
+ return deserialized # type: ignore
542
517
 
543
518
  @distributed_trace
544
519
  def get_statistics(
@@ -557,13 +532,6 @@ class ServiceOperations:
557
532
  limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
558
533
  value is None.
559
534
  :type request_id_parameter: str
560
- :keyword restype: restype. Default value is "service". Note that overriding this default value
561
- may result in unsupported behavior.
562
- :paramtype restype: str
563
- :keyword comp: comp. Default value is "stats". Note that overriding this default value may
564
- result in unsupported behavior.
565
- :paramtype comp: str
566
- :keyword callable cls: A custom type or function that will be passed the direct response
567
535
  :return: StorageServiceStats or the result of cls(response)
568
536
  :rtype: ~azure.storage.blob.models.StorageServiceStats
569
537
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -583,23 +551,22 @@ class ServiceOperations:
583
551
  comp: Literal["stats"] = kwargs.pop("comp", _params.pop("comp", "stats"))
584
552
  cls: ClsType[_models.StorageServiceStats] = kwargs.pop("cls", None)
585
553
 
586
- request = build_get_statistics_request(
554
+ _request = build_get_statistics_request(
587
555
  url=self._config.url,
588
556
  timeout=timeout,
589
557
  request_id_parameter=request_id_parameter,
590
558
  restype=restype,
591
559
  comp=comp,
592
560
  version=self._config.version,
593
- template_url=self.get_statistics.metadata["url"],
594
561
  headers=_headers,
595
562
  params=_params,
596
563
  )
597
- request = _convert_request(request)
598
- request.url = self._client.format_url(request.url)
564
+ _request = _convert_request(_request)
565
+ _request.url = self._client.format_url(_request.url)
599
566
 
600
567
  _stream = False
601
568
  pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
602
- request, stream=_stream, **kwargs
569
+ _request, stream=_stream, **kwargs
603
570
  )
604
571
 
605
572
  response = pipeline_response.http_response
@@ -620,11 +587,9 @@ class ServiceOperations:
620
587
  deserialized = self._deserialize("StorageServiceStats", pipeline_response)
621
588
 
622
589
  if cls:
623
- return cls(pipeline_response, deserialized, response_headers)
624
-
625
- return deserialized
590
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
626
591
 
627
- get_statistics.metadata = {"url": "{url}"}
592
+ return deserialized # type: ignore
628
593
 
629
594
  @distributed_trace
630
595
  def list_containers_segment(
@@ -669,10 +634,6 @@ class ServiceOperations:
669
634
  limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
670
635
  value is None.
671
636
  :type request_id_parameter: str
672
- :keyword comp: comp. Default value is "list". Note that overriding this default value may
673
- result in unsupported behavior.
674
- :paramtype comp: str
675
- :keyword callable cls: A custom type or function that will be passed the direct response
676
637
  :return: ListContainersSegmentResponse or the result of cls(response)
677
638
  :rtype: ~azure.storage.blob.models.ListContainersSegmentResponse
678
639
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -691,7 +652,7 @@ class ServiceOperations:
691
652
  comp: Literal["list"] = kwargs.pop("comp", _params.pop("comp", "list"))
692
653
  cls: ClsType[_models.ListContainersSegmentResponse] = kwargs.pop("cls", None)
693
654
 
694
- request = build_list_containers_segment_request(
655
+ _request = build_list_containers_segment_request(
695
656
  url=self._config.url,
696
657
  prefix=prefix,
697
658
  marker=marker,
@@ -701,16 +662,15 @@ class ServiceOperations:
701
662
  request_id_parameter=request_id_parameter,
702
663
  comp=comp,
703
664
  version=self._config.version,
704
- template_url=self.list_containers_segment.metadata["url"],
705
665
  headers=_headers,
706
666
  params=_params,
707
667
  )
708
- request = _convert_request(request)
709
- request.url = self._client.format_url(request.url)
668
+ _request = _convert_request(_request)
669
+ _request.url = self._client.format_url(_request.url)
710
670
 
711
671
  _stream = False
712
672
  pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
713
- request, stream=_stream, **kwargs
673
+ _request, stream=_stream, **kwargs
714
674
  )
715
675
 
716
676
  response = pipeline_response.http_response
@@ -730,11 +690,9 @@ class ServiceOperations:
730
690
  deserialized = self._deserialize("ListContainersSegmentResponse", pipeline_response)
731
691
 
732
692
  if cls:
733
- return cls(pipeline_response, deserialized, response_headers)
734
-
735
- return deserialized
693
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
736
694
 
737
- list_containers_segment.metadata = {"url": "{url}"}
695
+ return deserialized # type: ignore
738
696
 
739
697
  @distributed_trace
740
698
  def get_user_delegation_key(
@@ -758,13 +716,6 @@ class ServiceOperations:
758
716
  limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
759
717
  value is None.
760
718
  :type request_id_parameter: str
761
- :keyword restype: restype. Default value is "service". Note that overriding this default value
762
- may result in unsupported behavior.
763
- :paramtype restype: str
764
- :keyword comp: comp. Default value is "userdelegationkey". Note that overriding this default
765
- value may result in unsupported behavior.
766
- :paramtype comp: str
767
- :keyword callable cls: A custom type or function that will be passed the direct response
768
719
  :return: UserDelegationKey or the result of cls(response)
769
720
  :rtype: ~azure.storage.blob.models.UserDelegationKey
770
721
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -787,7 +738,7 @@ class ServiceOperations:
787
738
 
788
739
  _content = self._serialize.body(key_info, "KeyInfo", is_xml=True)
789
740
 
790
- request = build_get_user_delegation_key_request(
741
+ _request = build_get_user_delegation_key_request(
791
742
  url=self._config.url,
792
743
  timeout=timeout,
793
744
  request_id_parameter=request_id_parameter,
@@ -796,16 +747,15 @@ class ServiceOperations:
796
747
  content_type=content_type,
797
748
  version=self._config.version,
798
749
  content=_content,
799
- template_url=self.get_user_delegation_key.metadata["url"],
800
750
  headers=_headers,
801
751
  params=_params,
802
752
  )
803
- request = _convert_request(request)
804
- request.url = self._client.format_url(request.url)
753
+ _request = _convert_request(_request)
754
+ _request.url = self._client.format_url(_request.url)
805
755
 
806
756
  _stream = False
807
757
  pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
808
- request, stream=_stream, **kwargs
758
+ _request, stream=_stream, **kwargs
809
759
  )
810
760
 
811
761
  response = pipeline_response.http_response
@@ -826,23 +776,14 @@ class ServiceOperations:
826
776
  deserialized = self._deserialize("UserDelegationKey", pipeline_response)
827
777
 
828
778
  if cls:
829
- return cls(pipeline_response, deserialized, response_headers)
830
-
831
- return deserialized
779
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
832
780
 
833
- get_user_delegation_key.metadata = {"url": "{url}"}
781
+ return deserialized # type: ignore
834
782
 
835
783
  @distributed_trace
836
784
  def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
837
785
  """Returns the sku name and account kind.
838
786
 
839
- :keyword restype: restype. Default value is "account". Note that overriding this default value
840
- may result in unsupported behavior.
841
- :paramtype restype: str
842
- :keyword comp: comp. Default value is "properties". Note that overriding this default value may
843
- result in unsupported behavior.
844
- :paramtype comp: str
845
- :keyword callable cls: A custom type or function that will be passed the direct response
846
787
  :return: None or the result of cls(response)
847
788
  :rtype: None
848
789
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -862,21 +803,20 @@ class ServiceOperations:
862
803
  comp: Literal["properties"] = kwargs.pop("comp", _params.pop("comp", "properties"))
863
804
  cls: ClsType[None] = kwargs.pop("cls", None)
864
805
 
865
- request = build_get_account_info_request(
806
+ _request = build_get_account_info_request(
866
807
  url=self._config.url,
867
808
  restype=restype,
868
809
  comp=comp,
869
810
  version=self._config.version,
870
- template_url=self.get_account_info.metadata["url"],
871
811
  headers=_headers,
872
812
  params=_params,
873
813
  )
874
- request = _convert_request(request)
875
- request.url = self._client.format_url(request.url)
814
+ _request = _convert_request(_request)
815
+ _request.url = self._client.format_url(_request.url)
876
816
 
877
817
  _stream = False
878
818
  pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
879
- request, stream=_stream, **kwargs
819
+ _request, stream=_stream, **kwargs
880
820
  )
881
821
 
882
822
  response = pipeline_response.http_response
@@ -898,15 +838,13 @@ class ServiceOperations:
898
838
  response_headers["x-ms-is-hns-enabled"] = self._deserialize("bool", response.headers.get("x-ms-is-hns-enabled"))
899
839
 
900
840
  if cls:
901
- return cls(pipeline_response, None, response_headers)
902
-
903
- get_account_info.metadata = {"url": "{url}"}
841
+ return cls(pipeline_response, None, response_headers) # type: ignore
904
842
 
905
843
  @distributed_trace
906
844
  def submit_batch(
907
845
  self,
908
846
  content_length: int,
909
- body: IO,
847
+ body: IO[bytes],
910
848
  timeout: Optional[int] = None,
911
849
  request_id_parameter: Optional[str] = None,
912
850
  **kwargs: Any
@@ -916,7 +854,7 @@ class ServiceOperations:
916
854
  :param content_length: The length of the request. Required.
917
855
  :type content_length: int
918
856
  :param body: Initial data. Required.
919
- :type body: IO
857
+ :type body: IO[bytes]
920
858
  :param timeout: The timeout parameter is expressed in seconds. For more information, see
921
859
  :code:`<a
922
860
  href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
@@ -926,11 +864,7 @@ class ServiceOperations:
926
864
  limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
927
865
  value is None.
928
866
  :type request_id_parameter: str
929
- :keyword comp: comp. Default value is "batch". Note that overriding this default value may
930
- result in unsupported behavior.
931
- :paramtype comp: str
932
- :keyword callable cls: A custom type or function that will be passed the direct response
933
- :return: Iterator of the response bytes or the result of cls(response)
867
+ :return: Iterator[bytes] or the result of cls(response)
934
868
  :rtype: Iterator[bytes]
935
869
  :raises ~azure.core.exceptions.HttpResponseError:
936
870
  """
@@ -953,7 +887,7 @@ class ServiceOperations:
953
887
 
954
888
  _content = body
955
889
 
956
- request = build_submit_batch_request(
890
+ _request = build_submit_batch_request(
957
891
  url=self._config.url,
958
892
  content_length=content_length,
959
893
  timeout=timeout,
@@ -962,16 +896,15 @@ class ServiceOperations:
962
896
  multipart_content_type=multipart_content_type,
963
897
  version=self._config.version,
964
898
  content=_content,
965
- template_url=self.submit_batch.metadata["url"],
966
899
  headers=_headers,
967
900
  params=_params,
968
901
  )
969
- request = _convert_request(request)
970
- request.url = self._client.format_url(request.url)
902
+ _request = _convert_request(_request)
903
+ _request.url = self._client.format_url(_request.url)
971
904
 
972
905
  _stream = True
973
906
  pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
974
- request, stream=_stream, **kwargs
907
+ _request, stream=_stream, **kwargs
975
908
  )
976
909
 
977
910
  response = pipeline_response.http_response
@@ -993,8 +926,6 @@ class ServiceOperations:
993
926
 
994
927
  return deserialized # type: ignore
995
928
 
996
- submit_batch.metadata = {"url": "{url}"}
997
-
998
929
  @distributed_trace
999
930
  def filter_blobs(
1000
931
  self,
@@ -1039,10 +970,6 @@ class ServiceOperations:
1039
970
  :param include: Include this parameter to specify one or more datasets to include in the
1040
971
  response. Default value is None.
1041
972
  :type include: list[str or ~azure.storage.blob.models.FilterBlobsIncludeItem]
1042
- :keyword comp: comp. Default value is "blobs". Note that overriding this default value may
1043
- result in unsupported behavior.
1044
- :paramtype comp: str
1045
- :keyword callable cls: A custom type or function that will be passed the direct response
1046
973
  :return: FilterBlobSegment or the result of cls(response)
1047
974
  :rtype: ~azure.storage.blob.models.FilterBlobSegment
1048
975
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -1061,7 +988,7 @@ class ServiceOperations:
1061
988
  comp: Literal["blobs"] = kwargs.pop("comp", _params.pop("comp", "blobs"))
1062
989
  cls: ClsType[_models.FilterBlobSegment] = kwargs.pop("cls", None)
1063
990
 
1064
- request = build_filter_blobs_request(
991
+ _request = build_filter_blobs_request(
1065
992
  url=self._config.url,
1066
993
  timeout=timeout,
1067
994
  request_id_parameter=request_id_parameter,
@@ -1071,16 +998,15 @@ class ServiceOperations:
1071
998
  include=include,
1072
999
  comp=comp,
1073
1000
  version=self._config.version,
1074
- template_url=self.filter_blobs.metadata["url"],
1075
1001
  headers=_headers,
1076
1002
  params=_params,
1077
1003
  )
1078
- request = _convert_request(request)
1079
- request.url = self._client.format_url(request.url)
1004
+ _request = _convert_request(_request)
1005
+ _request.url = self._client.format_url(_request.url)
1080
1006
 
1081
1007
  _stream = False
1082
1008
  pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1083
- request, stream=_stream, **kwargs
1009
+ _request, stream=_stream, **kwargs
1084
1010
  )
1085
1011
 
1086
1012
  response = pipeline_response.http_response
@@ -1101,8 +1027,6 @@ class ServiceOperations:
1101
1027
  deserialized = self._deserialize("FilterBlobSegment", pipeline_response)
1102
1028
 
1103
1029
  if cls:
1104
- return cls(pipeline_response, deserialized, response_headers)
1105
-
1106
- return deserialized
1030
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
1107
1031
 
1108
- filter_blobs.metadata = {"url": "{url}"}
1032
+ return deserialized # type: ignore
@@ -3,6 +3,7 @@
3
3
  # Licensed under the MIT License. See License.txt in the project root for
4
4
  # license information.
5
5
  # --------------------------------------------------------------------------
6
+ # pylint: disable=docstring-keyword-should-match-keyword-only
6
7
 
7
8
  import uuid
8
9
 
@@ -651,7 +651,7 @@ class CopyProperties(DictMixin):
651
651
  self.source = kwargs.get('x-ms-copy-source')
652
652
  self.status = get_enum_value(kwargs.get('x-ms-copy-status'))
653
653
  self.progress = kwargs.get('x-ms-copy-progress')
654
- self.completion_time = kwargs.get('x-ms-copy-completion_time')
654
+ self.completion_time = kwargs.get('x-ms-copy-completion-time')
655
655
  self.status_description = kwargs.get('x-ms-copy-status-description')
656
656
  self.incremental_copy = kwargs.get('x-ms-incremental-copy')
657
657
  self.destination_snapshot = kwargs.get('x-ms-copy-destination-snapshot')
@@ -792,9 +792,8 @@ class AccessPolicy(GenAccessPolicy):
792
792
  :param start:
793
793
  The time at which the shared access signature becomes valid. If
794
794
  omitted, start time for this call is assumed to be the time when the
795
- storage service receives the request. Azure will always convert values
796
- to UTC. If a date is passed in without timezone info, it is assumed to
797
- be UTC.
795
+ storage service receives the request. The provided datetime will always
796
+ be interpreted as UTC.
798
797
  :type start: ~datetime.datetime or str
799
798
  """
800
799
  def __init__(self, permission=None, expiry=None, start=None):
@@ -57,6 +57,7 @@ _SUPPORTED_API_VERSIONS = [
57
57
  '2023-05-03',
58
58
  '2023-08-03',
59
59
  '2023-11-03',
60
+ '2024-05-04',
60
61
  ]
61
62
 
62
63
 
@@ -55,7 +55,7 @@ def _storage_header_sort(input_headers: List[Tuple[str, str]]) -> List[Tuple[str
55
55
  # Build list of sorted tuples
56
56
  sorted_headers = []
57
57
  for key in header_keys:
58
- sorted_headers.append((key, header_dict.get(key)))
58
+ sorted_headers.append((key, header_dict.pop(key)))
59
59
  return sorted_headers
60
60
 
61
61
 
@@ -433,9 +433,3 @@ class DatumReader(object):
433
433
  def skip_record(self, writer_schema, decoder):
434
434
  for field in writer_schema.fields:
435
435
  self.skip_data(field.type, decoder)
436
-
437
-
438
- # ------------------------------------------------------------------------------
439
-
440
- if __name__ == '__main__':
441
- raise Exception('Not a standalone module')
@@ -417,9 +417,3 @@ class AsyncDatumReader(object):
417
417
  async def skip_record(self, writer_schema, decoder):
418
418
  for field in writer_schema.fields:
419
419
  await self.skip_data(field.type, decoder)
420
-
421
-
422
- # ------------------------------------------------------------------------------
423
-
424
- if __name__ == '__main__':
425
- raise Exception('Not a standalone module')
@@ -255,7 +255,3 @@ class DataFileReader(object): # pylint: disable=too-many-instance-attributes
255
255
  def close(self):
256
256
  """Close this reader."""
257
257
  self.reader.close()
258
-
259
-
260
- if __name__ == '__main__':
261
- raise Exception('Not a standalone module')
@@ -208,7 +208,3 @@ class AsyncDataFileReader(object): # pylint: disable=too-many-instance-attribut
208
208
  def close(self):
209
209
  """Close this reader."""
210
210
  self.reader.close()
211
-
212
-
213
- if __name__ == '__main__':
214
- raise Exception('Not a standalone module')
@@ -194,7 +194,7 @@ class Schema(metaclass=abc.ABCMeta):
194
194
  # re-defining schemas that are already listed in the parameter names.
195
195
  @abc.abstractmethod
196
196
  def to_json(self, names):
197
- raise Exception('Cannot run abstract method.')
197
+ ...
198
198
 
199
199
 
200
200
  # ------------------------------------------------------------------------------
@@ -433,7 +433,7 @@ class NamedSchema(Schema):
433
433
  # of not re-defining schemas that are already listed in the parameter names.
434
434
  @abc.abstractmethod
435
435
  def to_json(self, names):
436
- raise Exception('Cannot run abstract method.')
436
+ ...
437
437
 
438
438
  # ------------------------------------------------------------------------------
439
439
 
@@ -1086,7 +1086,7 @@ def _schema_from_json_object(json_object, names):
1086
1086
  other_props=other_props,
1087
1087
  )
1088
1088
  else:
1089
- raise Exception(f'Internal error: unknown type {data_type!r}.')
1089
+ raise ValueError(f'Internal error: unknown type {data_type!r}.')
1090
1090
 
1091
1091
  elif data_type in VALID_TYPES:
1092
1092
  # Unnamed, non-primitive Avro type:
@@ -1118,7 +1118,7 @@ def _schema_from_json_object(json_object, names):
1118
1118
  result = ErrorUnionSchema(schemas=error_schemas)
1119
1119
 
1120
1120
  else:
1121
- raise Exception(f'Internal error: unknown type {data_type!r}.')
1121
+ raise ValueError(f'Internal error: unknown type {data_type!r}.')
1122
1122
  else:
1123
1123
  raise SchemaParseException(f'Invalid JSON descriptor for an Avro schema: {json_object!r}')
1124
1124
  return result