Skip to content

Commit 8d3838d

Browse files
[Storage] next-pylint April 25 (Azure#39839)
1 parent c975ade commit 8d3838d

File tree

17 files changed

+23
-32
lines changed

17 files changed

+23
-32
lines changed

sdk/storage/azure-storage-blob/azure/storage/blob/_shared/avro/avro_io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ def read_utf8(self):
162162
try:
163163
return input_bytes.decode('utf-8')
164164
except UnicodeDecodeError as exn:
165-
logger.error('Invalid UTF-8 input bytes: %r', input_bytes)
165+
logger.error('Invalid UTF-8 input bytes: %r', input_bytes) # pylint: disable=do-not-log-raised-errors
166166
raise exn
167167
else:
168168
# PY2
169-
return unicode(input_bytes, "utf-8") # pylint: disable=undefined-variable
169+
return unicode(input_bytes, "utf-8") # pylint: disable=undefined-variable
170170

171171
def skip_null(self):
172172
pass

sdk/storage/azure-storage-blob/azure/storage/blob/_shared/avro/avro_io_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async def read_utf8(self):
145145
try:
146146
return input_bytes.decode('utf-8')
147147
except UnicodeDecodeError as exn:
148-
logger.error('Invalid UTF-8 input bytes: %r', input_bytes)
148+
logger.error('Invalid UTF-8 input bytes: %r', input_bytes) # pylint: disable=do-not-log-raised-errors
149149
raise exn
150150
else:
151151
# PY2

sdk/storage/azure-storage-blob/azure/storage/blob/_shared/policies_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# --------------------------------------------------------------------------
66
# pylint: disable=invalid-overridden-method
77

8-
import asyncio
8+
import asyncio # pylint: disable=do-not-import-asyncio
99
import logging
1010
import random
1111
from typing import Any, Dict, TYPE_CHECKING

sdk/storage/azure-storage-blob/azure/storage/blob/_shared/request_handlers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ def validate_and_format_range_headers(
136136
return range_header, range_validation
137137

138138

139-
def add_metadata_headers(metadata=None):
140-
# type: (Optional[Dict[str, str]]) -> Dict[str, str]
139+
def add_metadata_headers(metadata: Optional[Dict[str, str]] = None) -> Dict[str, str]:
141140
headers = {}
142141
if metadata:
143142
for key, value in metadata.items():

sdk/storage/azure-storage-blob/azure/storage/blob/_shared/uploads_async.py

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

7-
import asyncio
7+
import asyncio # pylint: disable=do-not-import-asyncio
88
import inspect
99
import threading
10-
from asyncio import Lock
1110
from io import UnsupportedOperation
1211
from itertools import islice
1312
from math import ceil
@@ -165,7 +164,7 @@ def __init__(
165164

166165
# Progress feedback
167166
self.progress_total = 0
168-
self.progress_lock = Lock() if parallel else None
167+
self.progress_lock = asyncio.Lock() if parallel else None
169168
self.progress_hook = progress_hook
170169

171170
# Encryption

sdk/storage/azure-storage-blob/azure/storage/blob/aio/_download_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# pylint: disable=invalid-overridden-method
77
# mypy: disable-error-code=override
88

9-
import asyncio
9+
import asyncio # pylint: disable=do-not-import-asyncio
1010
import codecs
1111
import sys
1212
import warnings

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/policies_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# --------------------------------------------------------------------------
66
# pylint: disable=invalid-overridden-method
77

8-
import asyncio
8+
import asyncio # pylint: disable=do-not-import-asyncio
99
import logging
1010
import random
1111
from typing import Any, Dict, TYPE_CHECKING

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/request_handlers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ def validate_and_format_range_headers(
136136
return range_header, range_validation
137137

138138

139-
def add_metadata_headers(metadata=None):
140-
# type: (Optional[Dict[str, str]]) -> Dict[str, str]
139+
def add_metadata_headers(metadata: Optional[Dict[str, str]] = None) -> Dict[str, str]:
141140
headers = {}
142141
if metadata:
143142
for key, value in metadata.items():

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/uploads_async.py

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

7-
import asyncio
7+
import asyncio # pylint: disable=do-not-import-asyncio
88
import inspect
99
import threading
10-
from asyncio import Lock
1110
from io import UnsupportedOperation
1211
from itertools import islice
1312
from math import ceil
@@ -165,7 +164,7 @@ def __init__(
165164

166165
# Progress feedback
167166
self.progress_total = 0
168-
self.progress_lock = Lock() if parallel else None
167+
self.progress_lock = asyncio.Lock() if parallel else None
169168
self.progress_hook = progress_hook
170169

171170
# Encryption

sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/policies_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# --------------------------------------------------------------------------
66
# pylint: disable=invalid-overridden-method
77

8-
import asyncio
8+
import asyncio # pylint: disable=do-not-import-asyncio
99
import logging
1010
import random
1111
from typing import Any, Dict, TYPE_CHECKING

sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/request_handlers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ def validate_and_format_range_headers(
136136
return range_header, range_validation
137137

138138

139-
def add_metadata_headers(metadata=None):
140-
# type: (Optional[Dict[str, str]]) -> Dict[str, str]
139+
def add_metadata_headers(metadata: Optional[Dict[str, str]] = None) -> Dict[str, str]:
141140
headers = {}
142141
if metadata:
143142
for key, value in metadata.items():

sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/uploads_async.py

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

7-
import asyncio
7+
import asyncio # pylint: disable=do-not-import-asyncio
88
import inspect
99
import threading
10-
from asyncio import Lock
1110
from io import UnsupportedOperation
1211
from itertools import islice
1312
from math import ceil
@@ -165,7 +164,7 @@ def __init__(
165164

166165
# Progress feedback
167166
self.progress_total = 0
168-
self.progress_lock = Lock() if parallel else None
167+
self.progress_lock = asyncio.Lock() if parallel else None
169168
self.progress_hook = progress_hook
170169

171170
# Encryption

sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_download_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# pylint: disable=invalid-overridden-method
77
# mypy: disable-error-code=override
88

9-
import asyncio
9+
import asyncio # pylint: disable=do-not-import-asyncio
1010
import sys
1111
import warnings
1212
from io import BytesIO

sdk/storage/azure-storage-queue/azure/storage/queue/_serialize.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
from typing import (Any, Dict)
6+
from typing import Any, Dict
77

88
_SUPPORTED_API_VERSIONS = [
99
'2019-02-02',
@@ -31,8 +31,7 @@
3131
]
3232

3333

34-
def get_api_version(kwargs):
35-
# type: (Dict[str, Any]) -> str
34+
def get_api_version(kwargs: Dict[str, Any]) -> str:
3635
api_version = kwargs.get('api_version', None)
3736
if api_version and api_version not in _SUPPORTED_API_VERSIONS:
3837
versions = '\n'.join(_SUPPORTED_API_VERSIONS)

sdk/storage/azure-storage-queue/azure/storage/queue/_shared/policies_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# --------------------------------------------------------------------------
66
# pylint: disable=invalid-overridden-method
77

8-
import asyncio
8+
import asyncio # pylint: disable=do-not-import-asyncio
99
import logging
1010
import random
1111
from typing import Any, Dict, TYPE_CHECKING

sdk/storage/azure-storage-queue/azure/storage/queue/_shared/request_handlers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ def validate_and_format_range_headers(
136136
return range_header, range_validation
137137

138138

139-
def add_metadata_headers(metadata=None):
140-
# type: (Optional[Dict[str, str]]) -> Dict[str, str]
139+
def add_metadata_headers(metadata: Optional[Dict[str, str]] = None) -> Dict[str, str]:
141140
headers = {}
142141
if metadata:
143142
for key, value in metadata.items():

sdk/storage/azure-storage-queue/azure/storage/queue/_shared/uploads_async.py

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

7-
import asyncio
7+
import asyncio # pylint: disable=do-not-import-asyncio
88
import inspect
99
import threading
10-
from asyncio import Lock
1110
from io import UnsupportedOperation
1211
from itertools import islice
1312
from math import ceil
@@ -165,7 +164,7 @@ def __init__(
165164

166165
# Progress feedback
167166
self.progress_total = 0
168-
self.progress_lock = Lock() if parallel else None
167+
self.progress_lock = asyncio.Lock() if parallel else None
169168
self.progress_hook = progress_hook
170169

171170
# Encryption

0 commit comments

Comments
 (0)