Skip to content

Commit f79d1c7

Browse files
authored
[EH/SB/EG] next* (Azure#40483)
* next* * shouldnt return * pylint * this * this * tis
1 parent f9e29db commit f79d1c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+76
-99
lines changed

eng/pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[MASTER]
2-
py-version=3.9
2+
py-version=3.8
33
ignore-patterns=test_*,conftest,setup
44
reports=no
55

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_helpers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,15 @@ def _get_authentication_policy(credential, bearer_token_policy=BearerTokenCreden
8888
)
8989

9090

91-
def _is_cloud_event(event):
92-
# type: (Any) -> bool
91+
def _is_cloud_event(event: Any) -> bool:
9392
required = ("id", "source", "specversion", "type")
9493
try:
9594
return all((_ in event for _ in required)) and event["specversion"] == "1.0"
9695
except TypeError:
9796
return False
9897

9998

100-
def _is_eventgrid_event_format(event):
101-
# type: (Any) -> bool
99+
def _is_eventgrid_event_format(event: Any) -> bool:
102100
required = ("subject", "eventType", "data", "dataVersion", "id", "eventTime")
103101
try:
104102
return all((prop in event for prop in required))

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_policies.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class CloudEventDistributedTracingPolicy(SansIOHTTPPolicy):
2727

2828
_CONTENT_TYPE = "application/cloudevents-batch+json; charset=utf-8"
2929

30-
def on_request(self, request):
31-
# type: (PipelineRequest) -> None
30+
def on_request(self, request: "PipelineRequest") -> None:
3231
try:
3332
traceparent = request.http_request.headers["traceparent"]
3433
tracestate = request.http_request.headers["tracestate"]

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_publisher_client.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,10 @@ def __init__(
116116
self._api_version = api_version if api_version is not None else DEFAULT_API_VERSION
117117

118118
@staticmethod
119-
def _policies(credential, **kwargs):
120-
# type: (Union[AzureKeyCredential, AzureSasCredential, TokenCredential], Any) -> List[Any]
119+
def _policies(
120+
credential: Union["AzureKeyCredential", "AzureSasCredential", "TokenCredential"],
121+
**kwargs: Any
122+
) -> List[Any]:
121123
auth_policy = _get_authentication_policy(credential)
122124
sdk_moniker = "eventgrid/{}".format(VERSION)
123125
policies = [
@@ -234,16 +236,13 @@ def send(self, events: SendType, *, channel_name: Optional[str] = None, **kwargs
234236
map_error(status_code=response.status_code, response=response, error_map=error_map)
235237
raise HttpResponseError(response=response)
236238

237-
def close(self):
238-
# type: () -> None
239-
"""Close the :class:`~azure.eventgrid.EventGridPublisherClient` session."""
240-
return self._client.close()
239+
def close(self) -> None:
240+
"""Closes the EventGridPublisherClient session."""
241+
self._client.close()
241242

242-
def __enter__(self):
243-
# type: () -> EventGridPublisherClient
243+
def __enter__(self) -> "EventGridPublisherClient":
244244
self._client.__enter__()
245245
return self
246246

247-
def __exit__(self, *args):
248-
# type: (*Any) -> None
247+
def __exit__(self, *args) -> None:
249248
self._client.__exit__(*args)

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_legacy/_signature_credential_policy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ class EventGridSasCredentialPolicy(SansIOHTTPPolicy):
2020
:raises: ValueError or TypeError
2121
"""
2222

23-
def __init__(self, credential, name, **kwargs): # pylint: disable=unused-argument
24-
# type: (AzureSasCredential, str, Any) -> None
23+
def __init__(self, credential: "AzureSasCredential", name: str, **kwargs: Any) -> None: # pylint: disable=unused-argument
2524
super(EventGridSasCredentialPolicy, self).__init__()
2625
self._credential = credential
2726
if not name:

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_model_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ def _deserialize(cls, data, exist_discriminators):
633633
discriminator_value = data.find(xml_name).text # pyright: ignore
634634
else:
635635
discriminator_value = data.get(discriminator._rest_name)
636-
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore
636+
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member
637637
return mapped_cls._deserialize(data, exist_discriminators)
638638

639639
def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]:

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_client_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# license information.
55
# --------------------------------------------------------------------------
66
# TODO: Check types of kwargs (issue exists for this)
7-
import asyncio
7+
import asyncio # pylint:disable=do-not-import-asyncio
88
import logging
99
import time
1010
import queue

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_connection_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from urllib.parse import urlparse
1111
import socket
1212
from ssl import SSLError
13-
import asyncio
13+
import asyncio # pylint:disable=do-not-import-asyncio
1414
from typing import Any, Dict, List, Tuple, Optional, NamedTuple, Type, Union, cast
1515

1616
from ._transport_async import AsyncTransport

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_sender_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import uuid
88
import logging
99
import time
10-
import asyncio
10+
import asyncio # pylint:disable=do-not-import-asyncio
1111

1212
from .._encode import encode_payload
1313
from ._link_async import Link

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_session_async.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import uuid
99
import logging
1010
import time
11-
import asyncio
11+
import asyncio # pylint:disable=do-not-import-asyncio
1212
from typing import Optional, Union
1313

1414
from ..constants import ConnectionState, SessionState, SessionTransferState, Role
@@ -105,8 +105,7 @@ async def _on_connection_state_change(self):
105105
if self.state not in [SessionState.DISCARDING, SessionState.UNMAPPED]:
106106
await self._set_state(SessionState.DISCARDING)
107107

108-
def _get_next_output_handle(self):
109-
# type: () -> int
108+
def _get_next_output_handle(self) -> int:
110109
"""Get the next available outgoing handle number within the max handle limit.
111110
112111
:raises ValueError: If maximum handle has been reached.

0 commit comments

Comments
 (0)