@@ -647,8 +647,11 @@ async def set_container_access_policy(
647
647
process_storage_error (error )
648
648
649
649
@distributed_trace
650
- def list_blobs (self , name_starts_with = None , include = None , ** kwargs ):
651
- # type: (Optional[str], Optional[Union[str, List[str]]], **Any) -> AsyncItemPaged[BlobProperties]
650
+ def list_blobs (
651
+ self , name_starts_with : Optional [str ] = None ,
652
+ include : Optional [Union [str , List [str ]]] = None ,
653
+ ** kwargs : Any
654
+ ) -> AsyncItemPaged [BlobProperties ]:
652
655
"""Returns a generator to list the blobs under the specified container.
653
656
The generator will lazily follow the continuation tokens returned by
654
657
the service.
@@ -679,6 +682,10 @@ def list_blobs(self, name_starts_with=None, include=None, **kwargs):
679
682
:dedent: 12
680
683
:caption: List the blobs in the container.
681
684
"""
685
+ if kwargs .pop ('prefix' , None ):
686
+ raise ValueError ("Passing 'prefix' has no effect on filtering, " +
687
+ "please use the 'name_starts_with' parameter instead." )
688
+
682
689
if include and not isinstance (include , list ):
683
690
include = [include ]
684
691
@@ -718,6 +725,10 @@ def list_blob_names(self, **kwargs: Any) -> AsyncItemPaged[str]:
718
725
:returns: An iterable (auto-paging) response of blob names as strings.
719
726
:rtype: ~azure.core.async_paging.AsyncItemPaged[str]
720
727
"""
728
+ if kwargs .pop ('prefix' , None ):
729
+ raise ValueError ("Passing 'prefix' has no effect on filtering, " +
730
+ "please use the 'name_starts_with' parameter instead." )
731
+
721
732
name_starts_with = kwargs .pop ('name_starts_with' , None )
722
733
results_per_page = kwargs .pop ('results_per_page' , None )
723
734
timeout = kwargs .pop ('timeout' , None )
@@ -739,12 +750,11 @@ def list_blob_names(self, **kwargs: Any) -> AsyncItemPaged[str]:
739
750
740
751
@distributed_trace
741
752
def walk_blobs (
742
- self , name_starts_with = None , # type: Optional[str]
743
- include = None , # type: Optional[Union[List[str], str]]
744
- delimiter = "/" , # type: str
745
- ** kwargs # type: Optional[Any]
746
- ):
747
- # type: (...) -> AsyncItemPaged[BlobProperties]
753
+ self , name_starts_with : Optional [str ] = None ,
754
+ include : Optional [Union [List [str ], str ]] = None ,
755
+ delimiter : str = "/" ,
756
+ ** kwargs : Any
757
+ ) -> AsyncItemPaged [BlobProperties ]:
748
758
"""Returns a generator to list the blobs under the specified container.
749
759
The generator will lazily follow the continuation tokens returned by
750
760
the service. This operation will list blobs in accordance with a hierarchy,
@@ -772,6 +782,10 @@ def walk_blobs(
772
782
:returns: An iterable (auto-paging) response of BlobProperties.
773
783
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.storage.blob.BlobProperties]
774
784
"""
785
+ if kwargs .pop ('prefix' , None ):
786
+ raise ValueError ("Passing 'prefix' has no effect on filtering, " +
787
+ "please use the 'name_starts_with' parameter instead." )
788
+
775
789
if include and not isinstance (include , list ):
776
790
include = [include ]
777
791
0 commit comments