Skip to content

Commit 0f9a0c0

Browse files
committed
Revert "chore: add more typings"
This reverts commit 9c709fb.
1 parent a7736b8 commit 0f9a0c0

File tree

2 files changed

+4
-27
lines changed

2 files changed

+4
-27
lines changed

pyzabbix/__init__.py

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import logging
2-
from typing import Any, Mapping, Optional, Sequence, Tuple, Union
2+
from typing import Mapping, Optional, Sequence, Tuple, Union
33
from warnings import warn
44

55
from requests import Session
66
from requests.exceptions import JSONDecodeError
77
from semantic_version import Version # type: ignore
8-
from typing_extensions import NotRequired, TypedDict
98

109
logger = logging.getLogger(__name__)
1110
logger.addHandler(logging.NullHandler())
@@ -32,27 +31,6 @@ def __init__(self, *args, **kwargs):
3231
self.error = kwargs.get("error", None)
3332

3433

35-
class ZabbixAPIRequest(TypedDict):
36-
jsonrpc: str
37-
method: str
38-
params: Union[Sequence, Mapping]
39-
auth: NotRequired[str]
40-
id: int
41-
42-
43-
class Error(TypedDict):
44-
code: int
45-
message: str
46-
data: NotRequired[str]
47-
48-
49-
class ZabbixAPIResponse(TypedDict):
50-
jsonrpc: str
51-
result: Any
52-
error: NotRequired[Error]
53-
id: int
54-
55-
5634
# pylint: disable=too-many-instance-attributes
5735
class ZabbixAPI:
5836
# pylint: disable=too-many-arguments
@@ -200,8 +178,8 @@ def do_request(
200178
self,
201179
method: str,
202180
params: Optional[Union[Mapping, Sequence]] = None,
203-
) -> ZabbixAPIResponse:
204-
payload: ZabbixAPIRequest = {
181+
) -> dict:
182+
payload = {
205183
"jsonrpc": "2.0",
206184
"method": method,
207185
"params": params or {},
@@ -229,7 +207,7 @@ def do_request(
229207
raise ZabbixAPIException("Received empty response")
230208

231209
try:
232-
response: ZabbixAPIResponse = resp.json()
210+
response = resp.json()
233211
except JSONDecodeError as exception:
234212
raise ZabbixAPIException(
235213
f"Unable to parse json: {resp.text}"

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
install_requires=[
3636
"requests>=1.0",
3737
"semantic-version>=2.8",
38-
"typing_extensions",
3938
],
4039
extras_require={
4140
"dev": [

0 commit comments

Comments
 (0)