Skip to content

Commit 7af4a4d

Browse files
Linting fix for pylint 3.2.7 (Azure#39109)
* pylint 3.2.7 fixes 1st iteration * pylint 3.2.7 fixes 2nd iteration * pylint 3.2.7 fixes 3rd iteration * pylint / black fixes * next-pylint - pylint / black fixes * next-pylint - pylint / black fixes * next-pylint- mypy fixes
1 parent eeee45f commit 7af4a4d

File tree

203 files changed

+279
-449
lines changed

Some content is hidden

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

203 files changed

+279
-449
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/_arm_deployments/arm_deployment_executor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def deploy_resource(
8585
error_category=ErrorCategory.USER_ERROR,
8686
)
8787
error = None
88-
# pylint: disable=too-many-nested-blocks
8988
try:
9089
poller = self._get_poller(template=template, parameters=parameters)
9190
module_logger.info(

sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_artifact_utilities.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,12 @@ def list_logs_in_datastore(
188188
expiry=datetime.utcnow() + timedelta(minutes=30),
189189
)
190190

191-
log_dict[sub_name] = "{}/{}/{}?{}".format(ds_info["account_url"], ds_info["container_name"], item_name, token)
191+
log_dict[sub_name] = "{}/{}/{}?{}".format(
192+
ds_info["account_url"],
193+
ds_info["container_name"],
194+
item_name,
195+
token, # pylint: disable=possibly-used-before-assignment
196+
)
192197
return log_dict
193198

194199

sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_blob_storage_helper.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@ def check_blob_exists(self) -> None:
175175
properties = blob_client.get_blob_properties()
176176
except HttpResponseError as e:
177177
if e.error_code == KEY_AUTHENTICATION_ERROR_CODE: # pylint: disable=no-member
178-
formatted_msg = SAS_KEY_AUTHENTICATION_ERROR_MSG.format(
179-
e.error_code, e.exc_value
180-
) # pylint: disable=no-member
178+
formatted_msg = SAS_KEY_AUTHENTICATION_ERROR_MSG.format(e.error_code, e.exc_value)
181179
exception_with_documentation = Exception(formatted_msg)
182180
exception_with_documentation.__traceback__ = e.exc_traceback
183181
raise exception_with_documentation from e
@@ -209,7 +207,7 @@ def check_blob_exists(self) -> None:
209207
self.overwrite = True # if upload never confirmed, approve overriding the partial upload
210208
except ResourceNotFoundError:
211209
pass
212-
except Exception as e: # pylint: disable=W0718
210+
except Exception as e:
213211
# pylint: disable=no-member
214212
if hasattr(e, "error_code") and e.error_code == STORAGE_AUTH_MISMATCH_ERROR:
215213
msg = (

sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_fileshare_storage_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# ---------------------------------------------------------
44

5-
# pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes,client-method-missing-type-annotations,missing-client-constructor-parameter-kwargs
5+
# pylint: disable=client-accepts-api-version-keyword,client-method-missing-type-annotations,missing-client-constructor-parameter-kwargs
66

77
import logging
88
import os

sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_gen2_storage_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def check_blob_exists(self) -> None:
174174
self.name = metadata.get("name")
175175
self.version = metadata.get("version")
176176
raise AssetNotChangedError
177-
except Exception as e: # pylint: disable=W0718
177+
except Exception as e:
178178
# pylint: disable=no-member
179179
if hasattr(e, "error_code") and e.error_code == STORAGE_AUTH_MISMATCH_ERROR:
180180
msg = (

sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/component.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ def get_skip_fields(self):
119119
return ["properties"]
120120

121121
def _serialize(self, obj, *, many: bool = False):
122-
# pylint: disable=no-member
123122
if many and obj is not None:
124123
return super(InternalComponentSchema, self)._serialize(obj, many=many)
125124
ret = super(InternalComponentSchema, self)._serialize(obj)

sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/component.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,5 +366,5 @@ def _try_build_local_code(self) -> Iterable[Code]:
366366
ignore_file=rebased_ignore_file,
367367
)
368368

369-
def __call__(self, *args, **kwargs) -> InternalBaseNode: # pylint: disable=useless-super-delegation
369+
def __call__(self, *args, **kwargs) -> InternalBaseNode:
370370
return super(InternalComponent, self).__call__(*args, **kwargs)

sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/parallel.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# ---------------------------------------------------------
44

5-
# pylint: disable=protected-access
6-
75
from typing import List, Union
86

97
from marshmallow import Schema

sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/scope.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# ---------------------------------------------------------
44

5-
# pylint: disable=protected-access
6-
75
from typing import List, Union
86

97
from marshmallow import Schema

sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/azureml_image_context.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ def __init__(
6666
},
6767
}
6868
self._environment = {
69-
LocalEndpointConstants.ENVVAR_KEY_AZUREML_MODEL_DIR: docker_azureml_model_dir, # ie. /var/azureml-app/azureml-models/ # pylint: disable=line-too-long
69+
LocalEndpointConstants.ENVVAR_KEY_AZUREML_MODEL_DIR: docker_azureml_model_dir,
70+
# ie. /var/azureml-app/azureml-models/
7071
LocalEndpointConstants.ENVVAR_KEY_AZUREML_INFERENCE_PYTHON_PATH: LocalEndpointConstants.CONDA_ENV_BIN_PATH,
7172
}
7273

0 commit comments

Comments
 (0)