Skip to content

Commit 0cf80df

Browse files
Fix pylint warnings in azure-communication-chat package
Co-authored-by: kristapratico <[email protected]>
1 parent f69c92b commit 0cf80df

File tree

14 files changed

+24
-3
lines changed

14 files changed

+24
-3
lines changed

sdk/communication/azure-communication-chat/azure/communication/chat/_chat_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ def delete_chat_thread(
230230

231231
def close(self):
232232
# type: () -> None
233+
"""Close the ChatClient."""
233234
self._client.close()
234235

235236
def __enter__(self):

sdk/communication/azure-communication-chat/azure/communication/chat/_chat_thread_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ def remove_participant(
570570

571571
def close(self):
572572
# type: () -> None
573+
"""Close the ChatThreadClient."""
573574
return self._client.close()
574575

575576
def __enter__(self):

sdk/communication/azure-communication-chat/azure/communication/chat/_generated/_azure_communication_chat_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
9191
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
9292

9393
def close(self) -> None:
94+
"""Close the client."""
9495
self._client.close()
9596

9697
def __enter__(self) -> "AzureCommunicationChatService":

sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/_azure_communication_chat_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def _send_request(
9393
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
9494

9595
async def close(self) -> None:
96+
"""Close the client."""
9697
await self._client.close()
9798

9899
async def __aenter__(self) -> "AzureCommunicationChatService":

sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_operations.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# pylint: disable=too-many-lines,too-many-statements
1+
# pylint: disable=too-many-lines,too-many-statements,missing-function-docstring
22
# coding=utf-8
33
# --------------------------------------------------------------------------
44
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10,7 +10,6 @@
1010
from io import IOBase
1111
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
1212
import urllib.parse
13-
import uuid
1413

1514
from azure.core.exceptions import (
1615
ClientAuthenticationError,
@@ -39,6 +38,7 @@
3938

4039

4140
def build_create_chat_thread_request(*, repeatability_request_id: Optional[str] = None, **kwargs: Any) -> HttpRequest:
41+
"""Build HTTP request for creating a chat thread."""
4242
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
4343
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
4444

@@ -67,6 +67,7 @@ def build_create_chat_thread_request(*, repeatability_request_id: Optional[str]
6767
def build_list_chat_threads_request(
6868
*, max_page_size: Optional[int] = None, start_time: Optional[datetime.datetime] = None, **kwargs: Any
6969
) -> HttpRequest:
70+
"""Build HTTP request for listing chat threads."""
7071
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
7172
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
7273

@@ -90,6 +91,7 @@ def build_list_chat_threads_request(
9091

9192

9293
def build_delete_chat_thread_request(chat_thread_id: str, **kwargs: Any) -> HttpRequest:
94+
"""Build HTTP request for deleting a chat thread."""
9395
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
9496
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
9597

sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_thread_operations.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# pylint: disable=too-many-lines,too-many-statements
1+
# pylint: disable=too-many-lines,too-many-statements,missing-function-docstring
22
# coding=utf-8
33
# --------------------------------------------------------------------------
44
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -40,6 +40,7 @@
4040
def build_list_chat_read_receipts_request(
4141
chat_thread_id: str, *, max_page_size: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any
4242
) -> HttpRequest:
43+
"""Build HTTP request for listing chat read receipts."""
4344
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
4445
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
4546

@@ -68,6 +69,7 @@ def build_list_chat_read_receipts_request(
6869

6970

7071
def build_send_chat_read_receipt_request(chat_thread_id: str, **kwargs: Any) -> HttpRequest:
72+
"""Build HTTP request for sending a chat read receipt."""
7173
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
7274
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
7375

@@ -95,6 +97,7 @@ def build_send_chat_read_receipt_request(chat_thread_id: str, **kwargs: Any) ->
9597

9698

9799
def build_send_chat_message_request(chat_thread_id: str, **kwargs: Any) -> HttpRequest:
100+
"""Build HTTP request for sending a chat message."""
98101
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
99102
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
100103

@@ -128,6 +131,7 @@ def build_list_chat_messages_request(
128131
start_time: Optional[datetime.datetime] = None,
129132
**kwargs: Any
130133
) -> HttpRequest:
134+
"""Build HTTP request for listing chat messages."""
131135
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
132136
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
133137

sdk/communication/azure-communication-chat/azure/communication/chat/_shared/policy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,5 @@ def _sign_request(self, request):
117117
return request
118118

119119
def on_request(self, request):
120+
"""Called to sign the request."""
120121
self._sign_request(request)

sdk/communication/azure-communication-chat/azure/communication/chat/_shared/user_credential.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def __exit__(self, *args):
139139
self.close()
140140

141141
def close(self) -> None:
142+
"""Close the credential and cancel any pending refreshes."""
142143
if self._timer is not None:
143144
self._timer.cancel()
144145
self._timer = None

sdk/communication/azure-communication-chat/azure/communication/chat/_shared/user_credential_async.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ async def __aexit__(self, *args):
144144
await self.close()
145145

146146
async def close(self) -> None:
147+
"""Close the credential and cancel any pending refreshes."""
147148
if self._timer is not None:
148149
self._timer.cancel()
149150
self._timer = None

sdk/communication/azure-communication-chat/azure/communication/chat/_shared/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def _convert_datetime_to_utc_int(input_datetime) -> int:
2626

2727

2828
def parse_connection_str(conn_str: Optional[str]) -> Tuple[str, str]:
29+
"""Parse connection string into endpoint and access key."""
2930
if conn_str is None:
3031
raise ValueError("Connection string is undefined.")
3132
endpoint = None
@@ -51,10 +52,12 @@ def parse_connection_str(conn_str: Optional[str]) -> Tuple[str, str]:
5152

5253

5354
def get_current_utc_time() -> str:
55+
"""Get current UTC time as formatted string."""
5456
return str(datetime.now(tz=TZ_UTC).strftime("%a, %d %b %Y %H:%M:%S ")) + "GMT"
5557

5658

5759
def get_current_utc_as_int() -> int:
60+
"""Get current UTC time as integer."""
5861
current_utc_datetime = datetime.utcnow()
5962
return _convert_datetime_to_utc_int(current_utc_datetime)
6063

0 commit comments

Comments
 (0)