Skip to content

Commit 4b6ca92

Browse files
committed
Simplify import since json is already imported
1 parent 5cf8d2b commit 4b6ca92

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

meilisearch/_httprequests.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,7 @@
22

33
import json
44
from functools import lru_cache
5-
from typing import (
6-
TYPE_CHECKING,
7-
Any,
8-
Callable,
9-
List,
10-
Mapping,
11-
Optional,
12-
Sequence,
13-
Tuple,
14-
Type,
15-
Union,
16-
)
5+
from typing import Any, Callable, List, Mapping, Optional, Sequence, Tuple, Type, Union
176

187
import requests
198

@@ -26,9 +15,6 @@
2615
from meilisearch.models.index import ProximityPrecision
2716
from meilisearch.version import qualified_version
2817

29-
if TYPE_CHECKING:
30-
from json import JSONEncoder
31-
3218

3319
class HttpRequests:
3420
def __init__(self, config: Config) -> None:
@@ -54,7 +40,7 @@ def send_request(
5440
] = None,
5541
content_type: Optional[str] = None,
5642
*,
57-
serializer: Optional[Type[JSONEncoder]] = None,
43+
serializer: Optional[Type[json.JSONEncoder]] = None,
5844
) -> Any:
5945
if content_type:
6046
self.headers["Content-Type"] = content_type
@@ -97,7 +83,7 @@ def post(
9783
] = None,
9884
content_type: Optional[str] = "application/json",
9985
*,
100-
serializer: Optional[Type[JSONEncoder]] = None,
86+
serializer: Optional[Type[json.JSONEncoder]] = None,
10187
) -> Any:
10288
return self.send_request(requests.post, path, body, content_type, serializer=serializer)
10389

@@ -126,7 +112,7 @@ def put(
126112
] = None,
127113
content_type: Optional[str] = "application/json",
128114
*,
129-
serializer: Optional[Type[JSONEncoder]] = None,
115+
serializer: Optional[Type[json.JSONEncoder]] = None,
130116
) -> Any:
131117
return self.send_request(requests.put, path, body, content_type, serializer=serializer)
132118

0 commit comments

Comments
 (0)