Skip to content

Commit 88a742c

Browse files
[Tables] updating docstring (Azure#19547)
1 parent d57ed34 commit 88a742c

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

sdk/tables/azure-data-tables/azure/data/tables/_base_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7-
from typing import Dict, Optional, Any, List, Mapping, Union
7+
from typing import Dict, Optional, Any, List, Mapping, Union, TYPE_CHECKING
88
from uuid import uuid4
99
try:
1010
from urllib.parse import parse_qs, quote, urlparse
@@ -50,6 +50,8 @@
5050
)
5151
from ._sdk_moniker import SDK_MONIKER
5252

53+
if TYPE_CHECKING:
54+
from azure.core.credentials import TokenCredential
5355

5456
_SUPPORTED_API_VERSIONS = ["2019-02-02", "2019-07-07"]
5557

@@ -71,7 +73,7 @@ class AccountHostsMixin(object): # pylint: disable=too-many-instance-attributes
7173
def __init__(
7274
self,
7375
account_url, # type: Any
74-
credential=None, # type: Optional[Union[AzureNamedKeyCredential, AzureSasCredential]]
76+
credential=None, # type: Optional[Union[AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]]
7577
**kwargs # type: Any
7678
):
7779
# type: (...) -> None

sdk/tables/azure-data-tables/azure/data/tables/aio/_base_client_async.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7-
from typing import Any, List, Mapping, Optional, Union
7+
from typing import Any, List, Mapping, Optional, Union, TYPE_CHECKING
88
from uuid import uuid4
99

1010
from azure.core.credentials import AzureSasCredential, AzureNamedKeyCredential
@@ -35,17 +35,20 @@
3535
from .._sdk_moniker import SDK_MONIKER
3636
from ._policies_async import AsyncTablesRetryPolicy
3737

38+
if TYPE_CHECKING:
39+
from azure.core.credentials_async import AsyncTokenCredential
40+
3841

3942
class AsyncTablesBaseClient(AccountHostsMixin):
4043

4144
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
4245
self,
4346
endpoint: str,
4447
*,
45-
credential: Optional[Union[AzureSasCredential, AzureNamedKeyCredential]] = None,
48+
credential: Optional[Union[AzureSasCredential, AzureNamedKeyCredential, "AsyncTokenCredential"]] = None,
4649
**kwargs: Any
4750
) -> None:
48-
super(AsyncTablesBaseClient, self).__init__(endpoint, credential=credential, **kwargs)
51+
super(AsyncTablesBaseClient, self).__init__(endpoint, credential=credential, **kwargs) # type: ignore
4952
self._client = AzureTable(
5053
self.url,
5154
policies=kwargs.pop('policies', self._policies),

sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# license information.
55
# --------------------------------------------------------------------------
66
import functools
7-
from typing import List, Union, Any, Optional, Mapping, Iterable, Dict, overload, cast
7+
from typing import List, Union, Any, Optional, Mapping, Iterable, Dict, overload, cast, TYPE_CHECKING
88
try:
99
from urllib.parse import urlparse, unquote
1010
except ImportError:
@@ -38,6 +38,9 @@
3838
from ._models import TableEntityPropertiesPaged
3939
from ._table_batch_async import TableBatchOperations
4040

41+
if TYPE_CHECKING:
42+
from azure.core.credentials_async import AsyncTokenCredential
43+
4144

4245
class TableClient(AsyncTablesBaseClient):
4346
"""A client to interact with a specific Table in an Azure Tables account.
@@ -52,7 +55,7 @@ def __init__( # pylint: disable=missing-client-constructor-parameter-credential
5255
endpoint: str,
5356
table_name: str,
5457
*,
55-
credential: Optional[Union[AzureSasCredential, AzureNamedKeyCredential]] = None,
58+
credential: Optional[Union[AzureSasCredential, AzureNamedKeyCredential, "AsyncTokenCredential"]] = None,
5659
**kwargs
5760
) -> None:
5861
"""Create TableClient from a Credential.

sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def get_table_client(self, table_name: str, **kwargs) -> TableClient:
326326
return TableClient(
327327
self.url,
328328
table_name=table_name,
329-
credential=self.credential,
329+
credential=self.credential, # type: ignore
330330
api_version=self.api_version,
331331
pipeline=pipeline,
332332
location_mode=self._location_mode,

0 commit comments

Comments
 (0)