Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
from typing import MutableMapping


_LOGGER = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if sys.version_info >= (3, 9):
from collections.abc import Mapping
else:
from typing import Mapping # type: ignore # pylint: disable=ungrouped-imports
from typing import Mapping

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
if sys.version_info >= (3, 9):
from collections.abc import Mapping, MutableMapping
else:
from typing import Mapping, MutableMapping # type: ignore # pylint: disable=ungrouped-imports
from typing import Mapping, MutableMapping


_LOGGER = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def _create_xml_node(tag, prefix=None, ns=None):
return ET.Element(tag)


class Model(object):
class Model:
"""Mixin for all client request body/response body models to support
serialization and deserialization.
"""
Expand Down Expand Up @@ -563,7 +563,7 @@ def _decode_attribute_map_key(key):
return key.replace("\\.", ".")


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

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


class Deserializer(object):
class Deserializer:
"""Response object model deserializer.

:param dict classes: Class type dictionary for deserializing complex types.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
if sys.version_info >= (3, 9):
from collections.abc import Mapping, MutableMapping
else:
from typing import Mapping, MutableMapping # type: ignore # pylint: disable=ungrouped-imports
from typing import Mapping, MutableMapping


_LOGGER = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if sys.version_info >= (3, 9):
from collections.abc import Mapping
else:
from typing import Mapping # pylint: disable=ungrouped-imports
from typing import Mapping


JSON = Mapping[str, Any] # pylint: disable=unsubscriptable-object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def query_workspace(

generated_response: JSON = {}
try:
generated_response = self._query_op.execute( # pylint: disable=protected-access
generated_response = self._query_op.execute(
workspace_id=workspace_id, body=body, prefer=prefer, **kwargs
)
except HttpResponseError as err:
Expand Down Expand Up @@ -250,7 +250,7 @@ def query_resource(

generated_response: JSON = {}
try:
generated_response = self._query_op.resource_execute( # pylint: disable=protected-access
generated_response = self._query_op.resource_execute(
resource_id=resource_id, body=body, prefer=prefer, **kwargs
)
except HttpResponseError as err:
Expand All @@ -270,8 +270,8 @@ def close(self) -> None:
return self._client.close()

def __enter__(self) -> "LogsQueryClient":
self._client.__enter__() # pylint:disable=no-member
self._client.__enter__()
return self

def __exit__(self, *args: Any) -> None:
self._client.__exit__(*args) # pylint:disable=no-member
self._client.__exit__(*args)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from ._enums import MetricAggregationType
from ._helpers import get_authentication_policy, get_timespan_iso8601_endpoints, get_subscription_id_from_resource

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


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

def __enter__(self) -> "MetricsClient":
self._client.__enter__() # pylint:disable=no-member
self._client.__enter__()
return self

def __exit__(self, *args: Any) -> None:
self._client.__exit__(*args) # pylint:disable=no-member
self._client.__exit__(*args)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=anomalous-backslash-in-string
from datetime import timedelta, datetime
from typing import Any, cast, Optional, Tuple, Union, Sequence

Expand Down Expand Up @@ -240,8 +239,8 @@ def close(self) -> None:
return self._client.close()

def __enter__(self) -> "MetricsQueryClient":
self._client.__enter__() # pylint:disable=no-member
self._client.__enter__()
return self

def __exit__(self, *args: Any) -> None:
self._client.__exit__(*args) # pylint:disable=no-member
self._client.__exit__(*args)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
if sys.version_info >= (3, 9):
from collections.abc import Mapping
else:
from typing import Mapping # pylint: disable=ungrouped-imports
from typing import Mapping


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

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

Expand Down Expand Up @@ -326,7 +326,7 @@ def __init__(
*,
timespan: Optional[Union[timedelta, Tuple[datetime, timedelta], Tuple[datetime, datetime]]],
**kwargs: Any,
) -> None: # pylint: disable=super-init-not-called
) -> None:
include_statistics = kwargs.pop("include_statistics", False)
include_visualization = kwargs.pop("include_visualization", False)
server_timeout = kwargs.pop("server_timeout", None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ async def query_workspace(

generated_response: JSON = {}
try:
generated_response = await self._query_op.execute( # pylint: disable=protected-access
generated_response = await self._query_op.execute(
workspace_id=workspace_id, body=body, prefer=prefer, **kwargs
)
except HttpResponseError as err:
Expand Down Expand Up @@ -249,7 +249,7 @@ async def query_resource(

generated_response: JSON = {}
try:
generated_response = await self._query_op.resource_execute( # pylint: disable=protected-access
generated_response = await self._query_op.resource_execute(
resource_id=resource_id, body=body, prefer=prefer, **kwargs
)
except HttpResponseError as err:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from ._helpers_async import get_authentication_policy
from .._helpers import get_timespan_iso8601_endpoints, get_subscription_id_from_resource

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


class MetricsClient: # pylint: disable=client-accepts-api-version-keyword
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=anomalous-backslash-in-string
from datetime import timedelta, datetime
from typing import Any, cast, Optional, Tuple, Union, Sequence

Expand Down
Loading