Skip to content

Commit 9e01adc

Browse files
[Storage] [Next Pylint] Oct next-pylint Patches (Azure#37264)
1 parent ba5ef54 commit 9e01adc

File tree

94 files changed

+345
-331
lines changed

Some content is hidden

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

94 files changed

+345
-331
lines changed

sdk/storage/azure-storage-blob-changefeed/azure/storage/blob/changefeed/_change_feed_client.py

Lines changed: 1 addition & 1 deletion
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-
# pylint: disable=too-many-lines, docstring-keyword-should-match-keyword-only
6+
# pylint: disable=docstring-keyword-should-match-keyword-only
77

88
from typing import (
99
Any, Dict, Optional, Union,

sdk/storage/azure-storage-blob-changefeed/azure/storage/blob/changefeed/_models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
# pylint: disable=too-few-public-methods, too-many-instance-attributes
7-
# pylint: disable=super-init-not-called, too-many-lines
6+
# pylint: disable=too-few-public-methods
87
import collections
98
import copy
109
import json

sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def __init__(
187187
self._query_str, credential = self._format_query_string(sas_token, credential, snapshot=self.snapshot)
188188
super(BlobClient, self).__init__(parsed_url, service='blob', credential=credential, **kwargs)
189189
self._client = AzureBlobStorage(self.url, base_url=self.url, pipeline=self._pipeline)
190-
self._client._config.version = get_api_version(kwargs) # type: ignore [assignment] # pylint: disable=protected-access
190+
self._client._config.version = get_api_version(kwargs) # type: ignore [assignment]
191191
self._configure_encryption(kwargs)
192192

193193
def _format_url(self, hostname: str) -> str:
@@ -3289,7 +3289,7 @@ def _get_container_client(self) -> "ContainerClient":
32893289
policies=self._pipeline._impl_policies # pylint: disable = protected-access
32903290
)
32913291
else:
3292-
_pipeline = self._pipeline # pylint: disable = protected-access
3292+
_pipeline = self._pipeline
32933293
return ContainerClient(
32943294
f"{self.scheme}://{self.primary_hostname}", container_name=self.container_name,
32953295
credential=self._raw_credential, api_version=self.api_version, _configuration=self._config,

sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def _upload_blob_from_url_options(source_url: str, **kwargs: Any) -> Dict[str, A
229229
'headers': headers,
230230
}
231231
options.update(kwargs)
232-
if not overwrite and not _any_conditions(**options): # pylint: disable=protected-access
232+
if not overwrite and not _any_conditions(**options):
233233
options['modified_access_conditions'].if_none_match = '*'
234234
return options
235235

sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def __init__(
128128
self._query_str, credential = self._format_query_string(sas_token, credential)
129129
super(BlobServiceClient, self).__init__(parsed_url, service='blob', credential=credential, **kwargs)
130130
self._client = AzureBlobStorage(self.url, base_url=self.url, pipeline=self._pipeline)
131-
self._client._config.version = get_api_version(kwargs) # type: ignore [assignment] # pylint: disable=protected-access
131+
self._client._config.version = get_api_version(kwargs) # type: ignore [assignment]
132132
self._configure_encryption(kwargs)
133133

134134
def _format_url(self, hostname):

sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ def set_container_metadata(
624624
process_storage_error(error)
625625

626626
@distributed_trace
627-
def _get_blob_service_client(self) -> "BlobServiceClient": # pylint: disable=client-method-missing-kwargs
627+
def _get_blob_service_client(self) -> "BlobServiceClient":
628628
"""Get a client to interact with the container's parent service account.
629629
630630
Defaults to current container's credentials.
@@ -648,7 +648,7 @@ def _get_blob_service_client(self) -> "BlobServiceClient": # pylint: disable=cl
648648
policies=self._pipeline._impl_policies # pylint: disable = protected-access
649649
)
650650
else:
651-
_pipeline = self._pipeline # pylint: disable = protected-access
651+
_pipeline = self._pipeline
652652
return BlobServiceClient(
653653
f"{self.scheme}://{self.primary_hostname}",
654654
credential=self._raw_credential, api_version=self.api_version, _configuration=self._config,

sdk/storage/azure-storage-blob/azure/storage/blob/_container_client_helpers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def _generate_delete_blobs_options(
132132
for blob in blobs:
133133
if not isinstance(blob, str):
134134
blob_name = blob.get('name')
135-
options = _generic_delete_blob_options( # pylint: disable=protected-access
135+
options = _generic_delete_blob_options(
136136
snapshot=blob.get('snapshot'),
137137
version_id=blob.get('version_id'),
138138
delete_snapshots=delete_snapshots or blob.get('delete_snapshots'),
@@ -147,7 +147,7 @@ def _generate_delete_blobs_options(
147147
)
148148
else:
149149
blob_name = blob
150-
options = _generic_delete_blob_options( # pylint: disable=protected-access
150+
options = _generic_delete_blob_options(
151151
delete_snapshots=delete_snapshots,
152152
if_modified_since=if_modified_since,
153153
if_unmodified_since=if_unmodified_since,
@@ -199,11 +199,11 @@ def _generate_set_tiers_subrequest_options(
199199
query_parameters['versionid'] = client._serialize.query("version_id", version_id, 'str') # pylint: disable=protected-access
200200
if timeout is not None:
201201
query_parameters['timeout'] = client._serialize.query("timeout", timeout, 'int', minimum=0) # pylint: disable=protected-access
202-
query_parameters['comp'] = client._serialize.query("comp", comp, 'str') # pylint: disable=protected-access, specify-parameter-names-in-call
202+
query_parameters['comp'] = client._serialize.query("comp", comp, 'str') # pylint: disable=protected-access
203203

204204
# Construct headers
205205
header_parameters = {}
206-
header_parameters['x-ms-access-tier'] = client._serialize.header("tier", tier, 'str') # pylint: disable=protected-access, specify-parameter-names-in-call
206+
header_parameters['x-ms-access-tier'] = client._serialize.header("tier", tier, 'str') # pylint: disable=protected-access
207207
if rehydrate_priority is not None:
208208
header_parameters['x-ms-rehydrate-priority'] = client._serialize.header( # pylint: disable=protected-access
209209
"rehydrate_priority", rehydrate_priority, 'str')

sdk/storage/azure-storage-blob/azure/storage/blob/_deserialize.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def service_properties_deserialize(generated: "StorageServiceProperties") -> Dic
142142
'hour_metrics': Metrics._from_generated(generated.hour_metrics), # pylint: disable=protected-access
143143
'minute_metrics': Metrics._from_generated(generated.minute_metrics), # pylint: disable=protected-access
144144
'cors': cors_list,
145-
'target_version': generated.default_service_version, # pylint: disable=protected-access
145+
'target_version': generated.default_service_version,
146146
'delete_retention_policy': RetentionPolicy._from_generated(generated.delete_retention_policy), # pylint: disable=protected-access
147147
'static_website': StaticWebsite._from_generated(generated.static_website), # pylint: disable=protected-access
148148
}
@@ -181,7 +181,7 @@ def get_blob_properties_from_generated_code(generated: "BlobItemInternal") -> Bl
181181
blob.version_id = generated.version_id
182182
blob.is_current_version = generated.is_current_version
183183
blob.tag_count = generated.properties.tag_count
184-
blob.tags = parse_tags(generated.blob_tags) # pylint: disable=protected-access
184+
blob.tags = parse_tags(generated.blob_tags)
185185
blob.object_replication_source_properties = deserialize_ors_policies(generated.object_replication_metadata)
186186
blob.last_accessed_on = generated.properties.last_accessed_on
187187
blob.immutability_policy = ImmutabilityPolicy._from_generated(generated) # pylint: disable=protected-access

sdk/storage/azure-storage-blob/azure/storage/blob/_encryption.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ def _generate_encryption_data_dict(
508508
# We must pad the version to 8 bytes for AES Keywrap algorithms
509509
to_wrap = _ENCRYPTION_PROTOCOL_V2.encode().ljust(8, b'\0') + cek
510510
wrapped_cek = kek.wrap_key(to_wrap)
511+
else:
512+
raise ValueError("Invalid encryption version specified.")
511513

512514
# Build the encryption_data dict.
513515
# Use OrderedDict to comply with Java's ordering requirement.

sdk/storage/azure-storage-blob/azure/storage/blob/_list_blobs_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def _build_item(self, item: Union[BlobItemInternal, BlobProperties]) -> BlobProp
110110
if isinstance(item, BlobProperties):
111111
return item
112112
if isinstance(item, BlobItemInternal):
113-
blob = get_blob_properties_from_generated_code(item) # pylint: disable=protected-access
113+
blob = get_blob_properties_from_generated_code(item)
114114
blob.container = self.container # type: ignore [assignment]
115115
return blob
116116
return item

0 commit comments

Comments
 (0)