Skip to content

Commit 8f3af53

Browse files
authored
[Monitor] Pylint cleanup (Azure#38823)
Removing some useless suppressions. Signed-off-by: Paul Van Eck <[email protected]>
1 parent f9e8d67 commit 8f3af53

File tree

13 files changed

+23
-25
lines changed

13 files changed

+23
-25
lines changed

sdk/monitor/azure-monitor-ingestion/azure/monitor/ingestion/_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
if sys.version_info >= (3, 9):
1212
from collections.abc import MutableMapping
1313
else:
14-
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
14+
from typing import MutableMapping
1515

1616

1717
_LOGGER = logging.getLogger(__name__)

sdk/monitor/azure-monitor-ingestion/azure/monitor/ingestion/_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
if sys.version_info >= (3, 9):
99
from collections.abc import Mapping
1010
else:
11-
from typing import Mapping # type: ignore # pylint: disable=ungrouped-imports
11+
from typing import Mapping
1212

1313
JSON = Mapping[str, Any] # pylint: disable=unsubscriptable-object
1414

sdk/monitor/azure-monitor-ingestion/azure/monitor/ingestion/_operations/_patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
if sys.version_info >= (3, 9):
2020
from collections.abc import Mapping, MutableMapping
2121
else:
22-
from typing import Mapping, MutableMapping # type: ignore # pylint: disable=ungrouped-imports
22+
from typing import Mapping, MutableMapping
2323

2424

2525
_LOGGER = logging.getLogger(__name__)

sdk/monitor/azure-monitor-ingestion/azure/monitor/ingestion/_serialization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def _create_xml_node(tag, prefix=None, ns=None):
310310
return ET.Element(tag)
311311

312312

313-
class Model(object):
313+
class Model:
314314
"""Mixin for all client request body/response body models to support
315315
serialization and deserialization.
316316
"""
@@ -563,7 +563,7 @@ def _decode_attribute_map_key(key):
563563
return key.replace("\\.", ".")
564564

565565

566-
class Serializer(object): # pylint: disable=too-many-public-methods
566+
class Serializer: # pylint: disable=too-many-public-methods
567567
"""Request object model serializer."""
568568

569569
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -1441,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
14411441
return children[0]
14421442

14431443

1444-
class Deserializer(object):
1444+
class Deserializer:
14451445
"""Response object model deserializer.
14461446
14471447
:param dict classes: Class type dictionary for deserializing complex types.

sdk/monitor/azure-monitor-ingestion/azure/monitor/ingestion/aio/_operations/_patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
if sys.version_info >= (3, 9):
2020
from collections.abc import Mapping, MutableMapping
2121
else:
22-
from typing import Mapping, MutableMapping # type: ignore # pylint: disable=ungrouped-imports
22+
from typing import Mapping, MutableMapping
2323

2424

2525
_LOGGER = logging.getLogger(__name__)

sdk/monitor/azure-monitor-query/azure/monitor/query/_exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
if sys.version_info >= (3, 9):
1313
from collections.abc import Mapping
1414
else:
15-
from typing import Mapping # pylint: disable=ungrouped-imports
15+
from typing import Mapping
1616

1717

1818
JSON = Mapping[str, Any] # pylint: disable=unsubscriptable-object

sdk/monitor/azure-monitor-query/azure/monitor/query/_logs_query_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def query_workspace(
132132

133133
generated_response: JSON = {}
134134
try:
135-
generated_response = self._query_op.execute( # pylint: disable=protected-access
135+
generated_response = self._query_op.execute(
136136
workspace_id=workspace_id, body=body, prefer=prefer, **kwargs
137137
)
138138
except HttpResponseError as err:
@@ -250,7 +250,7 @@ def query_resource(
250250

251251
generated_response: JSON = {}
252252
try:
253-
generated_response = self._query_op.resource_execute( # pylint: disable=protected-access
253+
generated_response = self._query_op.resource_execute(
254254
resource_id=resource_id, body=body, prefer=prefer, **kwargs
255255
)
256256
except HttpResponseError as err:
@@ -270,8 +270,8 @@ def close(self) -> None:
270270
return self._client.close()
271271

272272
def __enter__(self) -> "LogsQueryClient":
273-
self._client.__enter__() # pylint:disable=no-member
273+
self._client.__enter__()
274274
return self
275275

276276
def __exit__(self, *args: Any) -> None:
277-
self._client.__exit__(*args) # pylint:disable=no-member
277+
self._client.__exit__(*args)

sdk/monitor/azure-monitor-query/azure/monitor/query/_metrics_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from ._enums import MetricAggregationType
1717
from ._helpers import get_authentication_policy, get_timespan_iso8601_endpoints, get_subscription_id_from_resource
1818

19-
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
19+
JSON = MutableMapping[str, Any]
2020

2121

2222
class MetricsClient: # pylint: disable=client-accepts-api-version-keyword
@@ -192,8 +192,8 @@ def close(self) -> None:
192192
return self._client.close()
193193

194194
def __enter__(self) -> "MetricsClient":
195-
self._client.__enter__() # pylint:disable=no-member
195+
self._client.__enter__()
196196
return self
197197

198198
def __exit__(self, *args: Any) -> None:
199-
self._client.__exit__(*args) # pylint:disable=no-member
199+
self._client.__exit__(*args)

sdk/monitor/azure-monitor-query/azure/monitor/query/_metrics_query_client.py

Lines changed: 2 additions & 3 deletions
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-
# pylint: disable=anomalous-backslash-in-string
87
from datetime import timedelta, datetime
98
from typing import Any, cast, Optional, Tuple, Union, Sequence
109

@@ -240,8 +239,8 @@ def close(self) -> None:
240239
return self._client.close()
241240

242241
def __enter__(self) -> "MetricsQueryClient":
243-
self._client.__enter__() # pylint:disable=no-member
242+
self._client.__enter__()
244243
return self
245244

246245
def __exit__(self, *args: Any) -> None:
247-
self._client.__exit__(*args) # pylint:disable=no-member
246+
self._client.__exit__(*args)

sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
if sys.version_info >= (3, 9):
1919
from collections.abc import Mapping
2020
else:
21-
from typing import Mapping # pylint: disable=ungrouped-imports
21+
from typing import Mapping
2222

2323

2424
JSON = Mapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -272,7 +272,7 @@ def _from_generated(cls, generated) -> "MetricsQueryResult":
272272
class MetricsList(list):
273273
"""Custom list for metrics."""
274274

275-
def __init__(self, **kwargs: Any) -> None: # pylint: disable=super-init-not-called
275+
def __init__(self, **kwargs: Any) -> None:
276276
self._metrics = kwargs["metrics"]
277277
self._metric_names = {val.name: ind for ind, val in enumerate(self._metrics)}
278278

@@ -326,7 +326,7 @@ def __init__(
326326
*,
327327
timespan: Optional[Union[timedelta, Tuple[datetime, timedelta], Tuple[datetime, datetime]]],
328328
**kwargs: Any,
329-
) -> None: # pylint: disable=super-init-not-called
329+
) -> None:
330330
include_statistics = kwargs.pop("include_statistics", False)
331331
include_visualization = kwargs.pop("include_visualization", False)
332332
server_timeout = kwargs.pop("server_timeout", None)

0 commit comments

Comments
 (0)