Skip to content

Commit 6eafa7a

Browse files
[Storage] [Typing] [Blob Changefeed] azure-storage-blob-changefeed (Azure#39731) (Azure#40002)
1 parent 864fa17 commit 6eafa7a

File tree

7 files changed

+212
-198
lines changed

7 files changed

+212
-198
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore

sdk/storage/azure-storage-blob-changefeed/azure/storage/blob/changefeed/_change_feed_client.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@
99
Any, Dict, Optional, Union,
1010
TYPE_CHECKING
1111
)
12+
from typing_extensions import Self
1213

1314
from azure.core.paging import ItemPaged
1415
from azure.core.tracing.decorator import distributed_trace
15-
from azure.storage.blob import BlobServiceClient # pylint: disable=no-name-in-module
16+
from azure.storage.blob._blob_service_client import BlobServiceClient
1617
from azure.storage.blob._shared.base_client import parse_connection_str
1718
from ._models import ChangeFeedPaged
1819

1920
if TYPE_CHECKING:
2021
from azure.core.credentials import AzureNamedKeyCredential, AzureSasCredential, TokenCredential
2122

2223

23-
class ChangeFeedClient(object):
24+
class ChangeFeedClient:
2425
"""A client to interact with a specific account change feed.
2526
2627
:param str account_url:
@@ -60,18 +61,18 @@ class ChangeFeedClient(object):
6061
:caption: Creating the ChangeFeedClient from a URL to a public blob (no auth needed).
6162
"""
6263
def __init__(
63-
self, account_url: str,
64-
credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long
65-
**kwargs: Any
66-
) -> None:
64+
self, account_url: str,
65+
credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long
66+
**kwargs: Any
67+
) -> None:
6768
self._blob_service_client = BlobServiceClient(account_url, credential, **kwargs)
6869

6970
@classmethod
7071
def from_connection_string(
71-
cls, conn_str: str,
72-
credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long
73-
**kwargs: Any
74-
) -> "ChangeFeedClient":
72+
cls, conn_str: str,
73+
credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long
74+
**kwargs: Any
75+
) -> Self:
7576
"""Create ChangeFeedClient from a Connection String.
7677
7778
:param str conn_str:
@@ -99,7 +100,7 @@ def from_connection_string(
99100
return cls(account_url, credential=credential, **kwargs)
100101

101102
@distributed_trace
102-
def list_changes(self, **kwargs: Any) -> ItemPaged[Dict]:
103+
def list_changes(self, **kwargs: Any) -> ItemPaged[Dict[str, Any]]:
103104
"""Returns a generator to list the change feed events.
104105
The generator will lazily follow the continuation tokens returned by
105106
the service.
@@ -135,4 +136,5 @@ def list_changes(self, **kwargs: Any) -> ItemPaged[Dict]:
135136
container_client,
136137
results_per_page=results_per_page,
137138
page_iterator_class=ChangeFeedPaged,
138-
**kwargs)
139+
**kwargs
140+
)

0 commit comments

Comments
 (0)