Skip to content

Commit eaaf8bd

Browse files
Copilotkingernupur
andcommitted
Fix pylint C4766 and C4762 errors in azure-ai-ml
Co-authored-by: kingernupur <[email protected]>
1 parent cfbc42e commit eaaf8bd

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
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
@@ -120,7 +120,6 @@ def deploy_resource(
120120
else:
121121
return poller
122122
except Exception as ex:
123-
module_logger.debug("Polling hit the exception %s\n", ex)
124123
raise ex
125124

126125
if error is not None:

sdk/ml/azure-ai-ml/azure/ai/ml/_azure_environments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def _get_clouds_by_metadata_url(metadata_url: str) -> Dict[str, Dict[str, str]]:
297297
)
298298
return cli_cloud_dict
299299
except Exception as ex: # pylint: disable=broad-except
300-
module_logger.warning(
300+
module_logger.debug(
301301
"Error: Azure ML was unable to load cloud metadata from the url specified by %s. %s. "
302302
"This may be due to a misconfiguration of networking controls. Azure Machine Learning Python "
303303
"SDK requires outbound access to Azure Resource Manager. Please contact your networking team "
@@ -330,7 +330,7 @@ def _convert_arm_to_cli(arm_cloud_metadata) -> Dict[str, Dict[str, str]]:
330330
EndpointURLS.REGISTRY_DISCOVERY_ENDPOINT: registry_discovery_url,
331331
}
332332
except KeyError as ex:
333-
module_logger.warning("Property on cloud not found in arm cloud metadata: %s", ex)
333+
module_logger.debug("Property on cloud not found in arm cloud metadata: %s", ex)
334334
continue
335335
return cli_cloud_metadata_dict
336336

sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_artifact_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def _download_artifacts(
239239
try:
240240
self._redirect_artifacts_tool_path(organization)
241241
except Exception as e: # pylint: disable=W0718
242-
_logger.warning("Redirect artifacts tool path failed, details: %s", e)
242+
_logger.debug("Redirect artifacts tool path failed, details: %s", e)
243243

244244
retries += 1
245245
result = subprocess.run(

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def _from_rest_object( # pylint: disable=too-many-return-statements
334334
raise ex
335335
except Exception as ex:
336336
error_message = json.dumps(obj.as_dict(), indent=2) if obj else None
337-
module_logger.info(
337+
module_logger.debug(
338338
"Exception: %s.\n%s\nUnable to parse the job resource: %s.\n",
339339
ex,
340340
traceback.format_exc(),

sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,9 @@ def _reset_version_if_no_change(self, component: Component, current_name: str, c
500500
)
501501
return component.version, component._to_rest_object()
502502
except ResourceNotFoundError as e:
503-
logger.info("Failed to get component version, %s", e)
503+
logger.debug("Failed to get component version, %s", e)
504504
except Exception as e: # pylint: disable=W0718
505-
logger.error("Failed to compare client_component_hash, %s", e)
505+
logger.debug("Failed to compare client_component_hash, %s", e)
506506

507507
return current_version, rest_component_resource
508508

sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_operations_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ def resource(self) -> Any:
11331133
# duration comes in format: "PT1M56.3454108S"
11341134
module_logger.info("Total time : %s\n", from_iso_duration_format_min_sec(total_duration))
11351135
except Exception as e: # pylint: disable=W0718
1136-
module_logger.warning("Exception occurred while logging total duration: %s", e)
1136+
module_logger.debug("Exception occurred while logging total duration: %s", e)
11371137
return self.func()
11381138

11391139
# pylint: disable=docstring-missing-param

0 commit comments

Comments
 (0)