Skip to content

Commit 77ae5d0

Browse files
lmazuelpvaneck
andauthored
Fix azure-core pylint issues (#39992)
Signed-off-by: Paul Van Eck <[email protected]> Co-authored-by: Paul Van Eck <[email protected]>
1 parent ae9758d commit 77ae5d0

File tree

8 files changed

+11
-9
lines changed

8 files changed

+11
-9
lines changed

sdk/core/azure-core/azure/core/pipeline/_base_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ async def prepare_requests(req):
200200

201201
# Not happy to make this code asyncio specific, but that's multipart only for now
202202
# If we need trio and multipart, let's reinvesitgate that later
203-
import asyncio
203+
import asyncio # pylint: disable=do-not-import-asyncio
204204

205205
await asyncio.gather(*[prepare_requests(req) for req in requests])
206206

sdk/core/azure-core/azure/core/pipeline/transport/_aiohttp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from collections.abc import AsyncIterator
4141

4242
import logging
43-
import asyncio
43+
import asyncio # pylint: disable=do-not-import-asyncio
4444
import codecs
4545
import aiohttp
4646
import aiohttp.client_exceptions

sdk/core/azure-core/azure/core/pipeline/transport/_base_async.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#
2525
# --------------------------------------------------------------------------
2626
from __future__ import annotations
27-
import asyncio
2827
import abc
2928
from collections.abc import AsyncIterator
3029
from typing import (
@@ -168,4 +167,6 @@ async def sleep(self, duration: float) -> None:
168167
169168
:param float duration: The number of seconds to sleep.
170169
"""
170+
import asyncio # pylint: disable=do-not-import-asyncio
171+
171172
await asyncio.sleep(duration)

sdk/core/azure-core/azure/core/pipeline/transport/_requests_asyncio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# IN THE SOFTWARE.
2424
#
2525
# --------------------------------------------------------------------------
26-
import asyncio
26+
import asyncio # pylint: disable=do-not-import-asyncio
2727
from collections.abc import AsyncIterator
2828
import functools
2929
import logging

sdk/core/azure-core/azure/core/rest/_aiohttp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#
2525
# --------------------------------------------------------------------------
2626
import collections.abc
27-
import asyncio
27+
import asyncio # pylint: disable=do-not-import-asyncio
2828
from itertools import groupby
2929
from typing import Iterator, cast
3030
from multidict import CIMultiDict
@@ -132,7 +132,7 @@ def values(self):
132132
def __getitem__(self, key: str) -> str:
133133
return ", ".join(self.getall(key, []))
134134

135-
def get(self, key, default=None):
135+
def get(self, key, /, default=None):
136136
values = self.getall(key, None)
137137
if values:
138138
values = ", ".join(values)

sdk/core/azure-core/azure/core/rest/_requests_asyncio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# IN THE SOFTWARE.
2424
#
2525
# --------------------------------------------------------------------------
26-
import asyncio
26+
import asyncio # pylint: disable=do-not-import-asyncio
2727
from ._http_response_impl_async import AsyncHttpResponseImpl
2828
from ._requests_basic import _RestRequestsTransportResponseBase
2929
from ..pipeline.transport._requests_asyncio import AsyncioStreamDownloadGenerator

sdk/core/azure-core/azure/core/utils/_pipeline_transport_rest_shared_async.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# Licensed under the MIT License. See License.txt in the project root for
55
# license information.
66
# --------------------------------------------------------------------------
7-
import asyncio
87
from typing import (
98
TYPE_CHECKING,
109
List,
@@ -57,6 +56,8 @@ async def parse_responses(response):
5756

5857
# Not happy to make this code asyncio specific, but that's multipart only for now
5958
# If we need trio and multipart, let's reinvesitgate that later
59+
import asyncio # pylint: disable=do-not-import-asyncio
60+
6061
await asyncio.gather(*[parse_responses(res) for res in responses])
6162

6263
return responses

sdk/core/azure-core/azure/core/utils/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def get_running_async_lock() -> AsyncContextManager:
174174
"""
175175

176176
try:
177-
import asyncio
177+
import asyncio # pylint: disable=do-not-import-asyncio
178178

179179
# Check if we are running in an asyncio event loop.
180180
asyncio.get_running_loop()

0 commit comments

Comments
 (0)