From 5fab5fe0e0a25253f33de6fb122200e179aa06df Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Fri, 11 Apr 2025 13:49:39 -0700 Subject: [PATCH 1/6] next* --- .../azure/eventgrid/_legacy/_helpers.py | 6 ++--- .../azure/eventgrid/_legacy/_policies.py | 3 +-- .../eventgrid/_legacy/_publisher_client.py | 15 ++++++------ .../_legacy/_signature_credential_policy.py | 3 +-- .../eventhub/_pyamqp/aio/_client_async.py | 2 +- .../eventhub/_pyamqp/aio/_connection_async.py | 2 +- .../eventhub/_pyamqp/aio/_sender_async.py | 2 +- .../eventhub/_pyamqp/aio/_session_async.py | 5 ++-- .../eventhub/_pyamqp/aio/_transport_async.py | 2 +- .../azure/eventhub/_pyamqp/session.py | 12 ++++------ .../azure/eventhub/aio/_async_utils.py | 4 ++-- .../_buffered_producer_async.py | 4 ++-- .../_buffered_producer_dispatcher_async.py | 4 ++-- .../_partition_resolver_async.py | 2 +- .../azure/eventhub/aio/_client_base_async.py | 2 +- .../eventhub/aio/_connection_manager_async.py | 2 +- .../azure/eventhub/aio/_consumer_async.py | 2 +- .../eventhub/aio/_consumer_client_async.py | 2 +- .../aio/_eventprocessor/event_processor.py | 2 +- .../eventhub/aio/_eventprocessor/utils.py | 2 +- .../azure/eventhub/aio/_producer_async.py | 2 +- .../eventhub/aio/_producer_client_async.py | 2 +- .../aio/_transport/_pyamqp_transport_async.py | 2 +- .../aio/_transport/_uamqp_transport_async.py | 2 +- .../servicebus/_pyamqp/aio/_client_async.py | 2 +- .../_pyamqp/aio/_connection_async.py | 2 +- .../servicebus/_pyamqp/aio/_sender_async.py | 2 +- .../servicebus/_pyamqp/aio/_session_async.py | 5 ++-- .../_pyamqp/aio/_transport_async.py | 2 +- .../azure/servicebus/_pyamqp/session.py | 12 ++++------ .../aio/_async_auto_lock_renewer.py | 2 +- .../azure/servicebus/aio/_async_utils.py | 2 +- .../servicebus/aio/_base_handler_async.py | 2 +- .../aio/_servicebus_receiver_async.py | 2 +- .../aio/_servicebus_sender_async.py | 2 +- .../management/_model_workaround.py | 9 +++---- .../management/_shared_key_policy.py | 6 ++--- .../azure/servicebus/management/_utils.py | 24 ++++++++++--------- .../management/_xml_workaround_policy.py | 3 +-- 39 files changed, 72 insertions(+), 91 deletions(-) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_helpers.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_helpers.py index 0d52e48ac1fc..d770b408aadf 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_helpers.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_helpers.py @@ -88,8 +88,7 @@ def _get_authentication_policy(credential, bearer_token_policy=BearerTokenCreden ) -def _is_cloud_event(event): - # type: (Any) -> bool +def _is_cloud_event(event: Any) -> bool: required = ("id", "source", "specversion", "type") try: return all((_ in event for _ in required)) and event["specversion"] == "1.0" @@ -97,8 +96,7 @@ def _is_cloud_event(event): return False -def _is_eventgrid_event_format(event): - # type: (Any) -> bool +def _is_eventgrid_event_format(event: Any) -> bool: required = ("subject", "eventType", "data", "dataVersion", "id", "eventTime") try: return all((prop in event for prop in required)) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_policies.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_policies.py index d4f2dcfd5638..e3ac741169bd 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_policies.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_policies.py @@ -27,8 +27,7 @@ class CloudEventDistributedTracingPolicy(SansIOHTTPPolicy): _CONTENT_TYPE = "application/cloudevents-batch+json; charset=utf-8" - def on_request(self, request): - # type: (PipelineRequest) -> None + def on_request(self, request: "PipelineRequest") -> None: try: traceparent = request.http_request.headers["traceparent"] tracestate = request.http_request.headers["tracestate"] diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py index 0dc9f0f27baf..ab9f46d7730e 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py @@ -116,8 +116,10 @@ def __init__( self._api_version = api_version if api_version is not None else DEFAULT_API_VERSION @staticmethod - def _policies(credential, **kwargs): - # type: (Union[AzureKeyCredential, AzureSasCredential, TokenCredential], Any) -> List[Any] + def _policies( + credential: Union["AzureKeyCredential", "AzureSasCredential", "TokenCredential"], + **kwargs: Any + ) -> List[Any]: auth_policy = _get_authentication_policy(credential) sdk_moniker = "eventgrid/{}".format(VERSION) policies = [ @@ -234,16 +236,13 @@ def send(self, events: SendType, *, channel_name: Optional[str] = None, **kwargs map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - def close(self): - # type: () -> None + def close(self) -> None: """Close the :class:`~azure.eventgrid.EventGridPublisherClient` session.""" return self._client.close() - def __enter__(self): - # type: () -> EventGridPublisherClient + def __enter__(self) -> "EventGridPublisherClient": self._client.__enter__() return self - def __exit__(self, *args): - # type: (*Any) -> None + def __exit__(self, *args) -> None: self._client.__exit__(*args) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_signature_credential_policy.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_signature_credential_policy.py index ca6004fed451..0e452167bf51 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_signature_credential_policy.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_signature_credential_policy.py @@ -20,8 +20,7 @@ class EventGridSasCredentialPolicy(SansIOHTTPPolicy): :raises: ValueError or TypeError """ - def __init__(self, credential, name, **kwargs): # pylint: disable=unused-argument - # type: (AzureSasCredential, str, Any) -> None + def __init__(self, credential: "AzureSasCredential", name: str, **kwargs: Any) -> None: # pylint: disable=unused-argument super(EventGridSasCredentialPolicy, self).__init__() self._credential = credential if not name: diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_client_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_client_async.py index 1f42ae7f44be..18085bf2bdb0 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_client_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_client_async.py @@ -4,7 +4,7 @@ # license information. # -------------------------------------------------------------------------- # TODO: Check types of kwargs (issue exists for this) -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import logging import time import queue diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_connection_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_connection_async.py index 53434ac2b0ae..681cf72c8082 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_connection_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_connection_async.py @@ -10,7 +10,7 @@ from urllib.parse import urlparse import socket from ssl import SSLError -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio from typing import Any, Dict, List, Tuple, Optional, NamedTuple, Type, Union, cast from ._transport_async import AsyncTransport diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_sender_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_sender_async.py index 8ea9f22d864c..abc559154c3a 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_sender_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_sender_async.py @@ -7,7 +7,7 @@ import uuid import logging import time -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio from .._encode import encode_payload from ._link_async import Link diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_session_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_session_async.py index a48abb9c9f93..88d4418d39b3 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_session_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_session_async.py @@ -8,7 +8,7 @@ import uuid import logging import time -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio from typing import Optional, Union from ..constants import ConnectionState, SessionState, SessionTransferState, Role @@ -105,8 +105,7 @@ async def _on_connection_state_change(self): if self.state not in [SessionState.DISCARDING, SessionState.UNMAPPED]: await self._set_state(SessionState.DISCARDING) - def _get_next_output_handle(self): - # type: () -> int + def _get_next_output_handle(self) -> int: """Get the next available outgoing handle number within the max handle limit. :raises ValueError: If maximum handle has been reached. diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_transport_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_transport_async.py index 93e340d4ff90..97a49c214506 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_transport_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_transport_async.py @@ -32,7 +32,7 @@ # THE POSSIBILITY OF SUCH DAMAGE. # ------------------------------------------------------------------------- -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import errno import socket import ssl diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/session.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/session.py index dfce295be8bd..a5d44f07fe0f 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/session.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/session.py @@ -81,8 +81,7 @@ def from_incoming_frame(cls, connection, channel): new_session = cls(connection, channel) return new_session - def _set_state(self, new_state): - # type: (SessionState) -> None + def _set_state(self, new_state: SessionState) -> None: """Update the session state. :param ~pyamqp.constants.SessionState new_state: The new state to set. """ @@ -104,8 +103,7 @@ def _on_connection_state_change(self): if self.state not in [SessionState.DISCARDING, SessionState.UNMAPPED]: self._set_state(SessionState.DISCARDING) - def _get_next_output_handle(self): - # type: () -> int + def _get_next_output_handle(self) -> int: """Get the next available outgoing handle number within the max handle limit. :raises ValueError: If maximum handle has been reached. @@ -374,8 +372,7 @@ def _incoming_detach(self, frame): ) ) - def _wait_for_response(self, wait, end_state): - # type: (Union[bool, float], SessionState) -> None + def _wait_for_response(self, wait: Union[bool, float], end_state: SessionState) -> None: if wait is True: self._connection.listen(wait=False) while self.state != end_state: @@ -398,8 +395,7 @@ def begin(self, wait=False): elif not self.allow_pipelined_open: raise ValueError("Connection has been configured to not allow piplined-open. Please set 'wait' parameter.") - def end(self, error=None, wait=False): - # type: (Optional[AMQPError], bool) -> None + def end(self, error: Optional[AMQPError] = None, wait: bool = False) -> None: try: if self.state not in [SessionState.UNMAPPED, SessionState.DISCARDING]: self._outgoing_end(error=error) diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_async_utils.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_async_utils.py index a93f8c2c5020..0a21e104cbbb 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_async_utils.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_async_utils.py @@ -3,9 +3,9 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import sys -from asyncio import Semaphore +from asyncio import Semaphore # pylint:disable=do-not-import-asyncio def get_dict_with_loop_if_needed(loop): diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_async.py index b9bb1329fd87..b0724eecaa9f 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_async.py @@ -3,11 +3,11 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from __future__ import annotations -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import logging import queue import time -from asyncio import Lock +from asyncio import Lock # pylint:disable=do-not-import-asyncio from typing import Optional, Callable, Awaitable, TYPE_CHECKING from .._producer_async import EventHubProducer diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_dispatcher_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_dispatcher_async.py index 3f8808f6cfd8..313b87a16032 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_dispatcher_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_dispatcher_async.py @@ -3,10 +3,10 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from __future__ import annotations -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import logging from typing import Dict, List, Callable, Optional, Awaitable, TYPE_CHECKING -from asyncio import Lock +from asyncio import Lock # pylint:disable=do-not-import-asyncio from ._partition_resolver_async import PartitionResolver from ...aio._producer_async import EventHubProducer diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_partition_resolver_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_partition_resolver_async.py index 7c67d17578dd..ae71b9c22655 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_partition_resolver_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_partition_resolver_async.py @@ -6,7 +6,7 @@ jenkins-hash lookup3 algorithm implementation """ -from asyncio import Lock +from asyncio import Lock # pylint:disable=do-not-import-asyncio from ..._buffered_producer._partition_resolver import ( generate_hash_code, ) diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_client_base_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_client_base_async.py index 9f329cdacfe2..db72edb00a40 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_client_base_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_client_base_async.py @@ -5,7 +5,7 @@ from __future__ import annotations import logging -import asyncio +import asyncio # pylint: disable=do-not-import-asyncio import time import functools from typing import TYPE_CHECKING, Any, Dict, List, Callable, Optional, Union, cast diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_connection_manager_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_connection_manager_async.py index 0977bbf56d12..8cb4de577dcf 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_connection_manager_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_connection_manager_async.py @@ -5,7 +5,7 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, Optional, Union -from asyncio import Lock +from asyncio import Lock # pylint:disable=do-not-import-asyncio from .._connection_manager import _ConnectionMode from .._constants import TransportType diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_consumer_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_consumer_async.py index 34449f27ccaf..784da77fea41 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_consumer_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_consumer_async.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from __future__ import annotations import uuid -import asyncio +import asyncio # pylint: disable=do-not-import-asyncio import logging from collections import deque from typing import TYPE_CHECKING, Callable, Awaitable, Dict, Optional, Union, List, Any, Deque diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_consumer_client_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_consumer_client_async.py index b603858ba91e..e41edb1e0798 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_consumer_client_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_consumer_client_async.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from __future__ import annotations -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import logging import datetime import warnings diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_eventprocessor/event_processor.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_eventprocessor/event_processor.py index 7c82fe590af2..81656240c031 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_eventprocessor/event_processor.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_eventprocessor/event_processor.py @@ -17,7 +17,7 @@ cast, ) import uuid -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import logging import time from functools import partial diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_eventprocessor/utils.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_eventprocessor/utils.py index 69b2ec77c4d3..b44854acdb98 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_eventprocessor/utils.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_eventprocessor/utils.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # ----------------------------------------------------------------------------------- -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio def get_running_loop() -> asyncio.AbstractEventLoop: diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_producer_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_producer_async.py index 76d8e4455801..2a270e297186 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_producer_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_producer_async.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from __future__ import annotations import uuid -import asyncio +import asyncio # pylint: disable=do-not-import-asyncio import logging from typing import Iterable, Union, Optional, Any, AnyStr, List, TYPE_CHECKING, cast diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_producer_client_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_producer_client_async.py index 035d52bc1b7e..129a396602c7 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_producer_client_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_producer_client_async.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import logging import time import warnings diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_transport/_pyamqp_transport_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_transport/_pyamqp_transport_async.py index 6378fd348de5..64c56e0b71d4 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_transport/_pyamqp_transport_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_transport/_pyamqp_transport_async.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from __future__ import annotations -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import time import logging from typing import Any, Callable, Dict, List, Optional, Union, cast, TYPE_CHECKING diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_transport/_uamqp_transport_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_transport/_uamqp_transport_async.py index 2c68c21795a0..c4fae70a0542 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_transport/_uamqp_transport_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_transport/_uamqp_transport_async.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from __future__ import annotations -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import time import logging from typing import Callable, Dict, Union, cast, TYPE_CHECKING, List, Optional, Any diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_client_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_client_async.py index 1f42ae7f44be..087a0c48b243 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_client_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_client_async.py @@ -4,7 +4,7 @@ # license information. # -------------------------------------------------------------------------- # TODO: Check types of kwargs (issue exists for this) -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import logging import time import queue diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_connection_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_connection_async.py index 53434ac2b0ae..681cf72c8082 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_connection_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_connection_async.py @@ -10,7 +10,7 @@ from urllib.parse import urlparse import socket from ssl import SSLError -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio from typing import Any, Dict, List, Tuple, Optional, NamedTuple, Type, Union, cast from ._transport_async import AsyncTransport diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_sender_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_sender_async.py index 8ea9f22d864c..abc559154c3a 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_sender_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_sender_async.py @@ -7,7 +7,7 @@ import uuid import logging import time -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio from .._encode import encode_payload from ._link_async import Link diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_session_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_session_async.py index a48abb9c9f93..88d4418d39b3 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_session_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_session_async.py @@ -8,7 +8,7 @@ import uuid import logging import time -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio from typing import Optional, Union from ..constants import ConnectionState, SessionState, SessionTransferState, Role @@ -105,8 +105,7 @@ async def _on_connection_state_change(self): if self.state not in [SessionState.DISCARDING, SessionState.UNMAPPED]: await self._set_state(SessionState.DISCARDING) - def _get_next_output_handle(self): - # type: () -> int + def _get_next_output_handle(self) -> int: """Get the next available outgoing handle number within the max handle limit. :raises ValueError: If maximum handle has been reached. diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_transport_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_transport_async.py index 93e340d4ff90..97a49c214506 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_transport_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_transport_async.py @@ -32,7 +32,7 @@ # THE POSSIBILITY OF SUCH DAMAGE. # ------------------------------------------------------------------------- -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import errno import socket import ssl diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/session.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/session.py index dfce295be8bd..a5d44f07fe0f 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/session.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/session.py @@ -81,8 +81,7 @@ def from_incoming_frame(cls, connection, channel): new_session = cls(connection, channel) return new_session - def _set_state(self, new_state): - # type: (SessionState) -> None + def _set_state(self, new_state: SessionState) -> None: """Update the session state. :param ~pyamqp.constants.SessionState new_state: The new state to set. """ @@ -104,8 +103,7 @@ def _on_connection_state_change(self): if self.state not in [SessionState.DISCARDING, SessionState.UNMAPPED]: self._set_state(SessionState.DISCARDING) - def _get_next_output_handle(self): - # type: () -> int + def _get_next_output_handle(self) -> int: """Get the next available outgoing handle number within the max handle limit. :raises ValueError: If maximum handle has been reached. @@ -374,8 +372,7 @@ def _incoming_detach(self, frame): ) ) - def _wait_for_response(self, wait, end_state): - # type: (Union[bool, float], SessionState) -> None + def _wait_for_response(self, wait: Union[bool, float], end_state: SessionState) -> None: if wait is True: self._connection.listen(wait=False) while self.state != end_state: @@ -398,8 +395,7 @@ def begin(self, wait=False): elif not self.allow_pipelined_open: raise ValueError("Connection has been configured to not allow piplined-open. Please set 'wait' parameter.") - def end(self, error=None, wait=False): - # type: (Optional[AMQPError], bool) -> None + def end(self, error: Optional[AMQPError] = None, wait: bool = False) -> None: try: if self.state not in [SessionState.UNMAPPED, SessionState.DISCARDING]: self._outgoing_end(error=error) diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_async_auto_lock_renewer.py b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_async_auto_lock_renewer.py index fdfc6c1104a8..5ebf24423936 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_async_auto_lock_renewer.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_async_auto_lock_renewer.py @@ -4,7 +4,7 @@ # license information. # ------------------------------------------------------------------------- -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import logging import datetime from typing import Optional, Iterable, Any, Union, Callable, Awaitable, List diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_async_utils.py b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_async_utils.py index 51ebaedf2921..0a5f3bf952d2 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_async_utils.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_async_utils.py @@ -6,7 +6,7 @@ import sys -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import logging import functools diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_base_handler_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_base_handler_async.py index 24dadaae211d..c97787ccb801 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_base_handler_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_base_handler_async.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import logging -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import uuid import time from typing import TYPE_CHECKING, Any, Callable, Optional, Dict, Union diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_receiver_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_receiver_async.py index 9507f6d7ef63..fa9ba1a0d679 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_receiver_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_receiver_async.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio from collections.abc import AsyncIterator import datetime import functools diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py index 2e3a43e1f2e0..f706e3b24f8b 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import logging -import asyncio +import asyncio # pylint:disable=do-not-import-asyncio import datetime import warnings from typing import Any, TYPE_CHECKING, Union, List, Optional, Mapping, cast, Iterable diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_model_workaround.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_model_workaround.py index 50de2cb9189d..78e1825d29ae 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_model_workaround.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_model_workaround.py @@ -244,8 +244,7 @@ ### End of code generated by the script. -def avoid_timedelta_overflow(td): - # type: (Optional[Union[timedelta, str]]) -> Optional[Union[timedelta, str]] +def avoid_timedelta_overflow(td: Optional[Union[timedelta, str]]) -> Optional[Union[timedelta, str]]: """Service Bus REST API uses "P10675199DT2H48M5.4775807S" as default value for some properties, which are of type datetime.timedelta. When they are deserialized, Python round the milliseconds from 4775807 to 477581. When we get an entity (for instance, QueueDescription) and update this entity, this default value is @@ -267,8 +266,7 @@ def avoid_timedelta_overflow(td): return result -def _adjust_dict_key_sequence(dct, keys): - # type: (Dict[str, Any], Iterable[str]) -> Dict[str, Any] +def _adjust_dict_key_sequence(dct: Dict[str, Any], keys: Iterable[str]) -> Dict[str, Any]: result = OrderedDict() for key in keys: @@ -277,8 +275,7 @@ def _adjust_dict_key_sequence(dct, keys): return result -def adjust_attribute_map(): - # type: () -> None +def adjust_attribute_map() -> None: """create_xxx and update_xxx will serialize XXXDescription to XML. The tags sequence is important to service. This workaround is to convert the _attribute_map of each model class to use OrderedDict instead of dict so their serialized XML tags use the same sequence as diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_shared_key_policy.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_shared_key_policy.py index 38ba7de35b9a..2e93caa89074 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_shared_key_policy.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_shared_key_policy.py @@ -17,8 +17,7 @@ class ServiceBusSharedKeyCredentialPolicy(SansIOHTTPPolicy): :param str name: """ - def __init__(self, endpoint, credential, name): - # type: (str, ServiceBusSharedKeyCredential, str) -> None + def __init__(self, endpoint: str, credential: ServiceBusSharedKeyCredential, name: str): super(ServiceBusSharedKeyCredentialPolicy, self).__init__() self._credential = credential self._endpoint = endpoint @@ -36,8 +35,7 @@ def _update_token(self): self._token_expiry_on = access_token.expires_on self._token = access_token.token - def on_request(self, request): - # type: (PipelineRequest) -> None + def on_request(self, request: PipelineRequest) -> None: """Adds an Authorization header to request and sends request to next policy. :param request: The pipeline request object diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py index 931ece33962c..2cdaebb0e597 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py @@ -281,14 +281,12 @@ def serialize_rule_key_values(entry_ele, rule_descripiton): # Helper functions for common parameter validation errors in the client. -def _validate_entity_name_type(entity_name, display_name="entity name"): - # type: (str, str) -> None +def _validate_entity_name_type(entity_name: str, display_name: str ="entity name") -> None: if not isinstance(entity_name, str): raise TypeError("{} must be a string, not {}".format(display_name, type(entity_name))) -def _validate_topic_and_subscription_types(topic_name, subscription_name): - # type: (str, str) -> None +def _validate_topic_and_subscription_types(topic_name: str, subscription_name: str) -> None: if not isinstance(topic_name, str) or not isinstance(subscription_name, str): raise TypeError( "topic name and subscription name must be strings, not {} and {}".format( @@ -297,8 +295,7 @@ def _validate_topic_and_subscription_types(topic_name, subscription_name): ) -def _validate_topic_subscription_and_rule_types(topic_name, subscription_name, rule_name): - # type: (str, str, str) -> None +def _validate_topic_subscription_and_rule_types(topic_name: str, subscription_name: str, rule_name: str) -> None: if not isinstance(topic_name, str) or not isinstance(subscription_name, str) or not isinstance(rule_name, str): raise TypeError( "topic name, subscription name and rule name must be strings, not {} {} and {}".format( @@ -307,17 +304,22 @@ def _validate_topic_subscription_and_rule_types(topic_name, subscription_name, r ) -def _normalize_entity_path_to_full_path_if_needed(entity_path, fully_qualified_namespace): - # type: (Optional[str], str) -> Optional[str] +def _normalize_entity_path_to_full_path_if_needed( + entity_path: Optional[str], + fully_qualified_namespace: str + ) -> Optional[str]: if not entity_path: return entity_path parsed = urlparse.urlparse(entity_path) - entity_path = ("sb://" + fully_qualified_namespace + "/" + entity_path) if not parsed.netloc else entity_path + entity_path = ("sb://" + fully_qualified_namespace + "/" + entity_path) \ + if not parsed.netloc else entity_path return entity_path -def create_properties_from_dict_if_needed(properties, sb_resource_type): - # type: (Union[PropertiesType, Mapping[str, Any]], Type[PropertiesType]) -> PropertiesType +def create_properties_from_dict_if_needed( + properties: Union["PropertiesType", Mapping[str, Any]], + sb_resource_type: Type["PropertiesType"] + ) -> "PropertiesType": """ This method is used to create a properties object given the resource properties type and its corresponding dict representation. diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_xml_workaround_policy.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_xml_workaround_policy.py index 43471491891e..ae22cdc00b38 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_xml_workaround_policy.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_xml_workaround_policy.py @@ -22,8 +22,7 @@ class ServiceBusXMLWorkaroundPolicy(SansIOHTTPPolicy): """ - def on_request(self, request): - # type: (PipelineRequest) -> None + def on_request(self, request: PipelineRequest) -> None: """Mutate serialized (QueueDescription, TopicDescription, SubscriptionDescription, RuleDescription) XML to use default namespace. From a36c4f890f0e6d2c979a16e7bc9795e289e34075 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Fri, 11 Apr 2025 14:18:50 -0700 Subject: [PATCH 2/6] shouldnt return --- .../azure/eventgrid/_legacy/_publisher_client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py index ab9f46d7730e..1145a29d9da1 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py @@ -237,8 +237,7 @@ def send(self, events: SendType, *, channel_name: Optional[str] = None, **kwargs raise HttpResponseError(response=response) def close(self) -> None: - """Close the :class:`~azure.eventgrid.EventGridPublisherClient` session.""" - return self._client.close() + self._client.close() def __enter__(self) -> "EventGridPublisherClient": self._client.__enter__() From 353d34648a7fa1660a734846c7ca1d74152c73ce Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Mon, 14 Apr 2025 13:05:44 -0700 Subject: [PATCH 3/6] pylint --- .../azure/eventgrid/_legacy/_publisher_client.py | 1 + .../azure-eventhub/azure/eventhub/aio/_async_utils.py | 4 +--- .../aio/_buffered_producer/_buffered_producer_async.py | 3 +-- .../azure/servicebus/management/_shared_key_policy.py | 2 +- .../azure-servicebus/azure/servicebus/management/_utils.py | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py index 1145a29d9da1..9250a614c0a6 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py @@ -237,6 +237,7 @@ def send(self, events: SendType, *, channel_name: Optional[str] = None, **kwargs raise HttpResponseError(response=response) def close(self) -> None: + """Closes the EventGridPublisherClient session.""" self._client.close() def __enter__(self) -> "EventGridPublisherClient": diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_async_utils.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_async_utils.py index 0a21e104cbbb..2a5b5f08ad5e 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_async_utils.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_async_utils.py @@ -5,8 +5,6 @@ # -------------------------------------------------------------------------- import asyncio # pylint:disable=do-not-import-asyncio import sys -from asyncio import Semaphore # pylint:disable=do-not-import-asyncio - def get_dict_with_loop_if_needed(loop): if sys.version_info >= (3, 10): @@ -17,7 +15,7 @@ def get_dict_with_loop_if_needed(loop): return {} -async def semaphore_acquire_with_timeout(semaphore: Semaphore, timeout=None): +async def semaphore_acquire_with_timeout(semaphore: asyncio.Semaphore, timeout=None): try: return await asyncio.wait_for(semaphore.acquire(), timeout=timeout) except asyncio.TimeoutError: diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_async.py index b0724eecaa9f..6f7ac4d3958b 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_async.py @@ -7,7 +7,6 @@ import logging import queue import time -from asyncio import Lock # pylint:disable=do-not-import-asyncio from typing import Optional, Callable, Awaitable, TYPE_CHECKING from .._producer_async import EventHubProducer @@ -39,7 +38,7 @@ def __init__( self._max_buffer_len = max_buffer_length self._cur_buffered_len = 0 self._producer: EventHubProducer = producer - self._lock = Lock() + self._lock = asyncio.Lock() self._max_wait_time = max_wait_time self._on_success = self.failsafe_callback(on_success) self._on_error = self.failsafe_callback(on_error) diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_shared_key_policy.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_shared_key_policy.py index 2e93caa89074..2c354f962806 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_shared_key_policy.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_shared_key_policy.py @@ -17,7 +17,7 @@ class ServiceBusSharedKeyCredentialPolicy(SansIOHTTPPolicy): :param str name: """ - def __init__(self, endpoint: str, credential: ServiceBusSharedKeyCredential, name: str): + def __init__(self, endpoint: str, credential: ServiceBusSharedKeyCredential, name: str) -> None: super(ServiceBusSharedKeyCredentialPolicy, self).__init__() self._credential = credential self._endpoint = endpoint diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py index 2cdaebb0e597..1415405d7bb4 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py @@ -281,7 +281,7 @@ def serialize_rule_key_values(entry_ele, rule_descripiton): # Helper functions for common parameter validation errors in the client. -def _validate_entity_name_type(entity_name: str, display_name: str ="entity name") -> None: +def _validate_entity_name_type(entity_name: str, display_name: str = "entity name") -> None: if not isinstance(entity_name, str): raise TypeError("{} must be a string, not {}".format(display_name, type(entity_name))) From 36701d627e20bfcfb7a2b508902a3c04614ff662 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Mon, 14 Apr 2025 13:18:07 -0700 Subject: [PATCH 4/6] this --- sdk/eventgrid/azure-eventgrid/azure/eventgrid/_model_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_model_base.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_model_base.py index 7f73b97b23ef..ff8dc9bc9eaa 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_model_base.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_model_base.py @@ -633,7 +633,7 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member return mapped_cls._deserialize(data, exist_discriminators) def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: From 13569a611e15d1959a42de9aea2ee3aa0fe15e6a Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Mon, 14 Apr 2025 13:22:44 -0700 Subject: [PATCH 5/6] this --- .../_buffered_producer/_buffered_producer_dispatcher_async.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_dispatcher_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_dispatcher_async.py index 313b87a16032..6fd15bfbd2f7 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_dispatcher_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_buffered_producer/_buffered_producer_dispatcher_async.py @@ -6,7 +6,6 @@ import asyncio # pylint:disable=do-not-import-asyncio import logging from typing import Dict, List, Callable, Optional, Awaitable, TYPE_CHECKING -from asyncio import Lock # pylint:disable=do-not-import-asyncio from ._partition_resolver_async import PartitionResolver from ...aio._producer_async import EventHubProducer @@ -37,7 +36,7 @@ def __init__( ): self._buffered_producers: Dict[str, BufferedProducer] = {} self._partition_ids: List[str] = partitions - self._lock = Lock() + self._lock = asyncio.Lock() self._on_success = on_success self._on_error = on_error self._create_producer = create_producer From 619bd2d8a4f556eb8ceb1445d4884b7d08429963 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Mon, 14 Apr 2025 15:02:22 -0700 Subject: [PATCH 6/6] tis --- eng/pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pylintrc b/eng/pylintrc index 41a61ea45b19..0a685059adfc 100644 --- a/eng/pylintrc +++ b/eng/pylintrc @@ -1,5 +1,5 @@ [MASTER] -py-version=3.9 +py-version=3.8 ignore-patterns=test_*,conftest,setup reports=no