crate 2.0.0.dev3__py3-none-any.whl → 2.0.0.dev5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- crate/client/__init__.py +1 -1
- crate/client/http.py +18 -7
- {crate-2.0.0.dev3.dist-info → crate-2.0.0.dev5.dist-info}/METADATA +1 -1
- {crate-2.0.0.dev3.dist-info → crate-2.0.0.dev5.dist-info}/RECORD +8 -8
- {crate-2.0.0.dev3.dist-info → crate-2.0.0.dev5.dist-info}/LICENSE +0 -0
- {crate-2.0.0.dev3.dist-info → crate-2.0.0.dev5.dist-info}/NOTICE +0 -0
- {crate-2.0.0.dev3.dist-info → crate-2.0.0.dev5.dist-info}/WHEEL +0 -0
- {crate-2.0.0.dev3.dist-info → crate-2.0.0.dev5.dist-info}/top_level.txt +0 -0
crate/client/__init__.py
CHANGED
crate/client/http.py
CHANGED
@@ -28,6 +28,7 @@ import re
|
|
28
28
|
import socket
|
29
29
|
import ssl
|
30
30
|
import threading
|
31
|
+
import typing as t
|
31
32
|
from base64 import b64encode
|
32
33
|
from decimal import Decimal
|
33
34
|
from time import time
|
@@ -83,22 +84,32 @@ def super_len(o):
|
|
83
84
|
return None
|
84
85
|
|
85
86
|
|
86
|
-
def cratedb_json_encoder(obj):
|
87
|
+
def cratedb_json_encoder(obj: t.Any) -> str:
|
87
88
|
"""
|
88
|
-
Encoder function for orjson.
|
89
|
+
Encoder function for orjson, with additional type support.
|
90
|
+
|
91
|
+
- Python's `Decimal` type.
|
92
|
+
- freezegun's `FakeDatetime` type.
|
89
93
|
|
90
94
|
https://github.com/ijl/orjson#default
|
91
95
|
"""
|
92
|
-
if isinstance(obj,
|
96
|
+
if isinstance(obj, Decimal):
|
93
97
|
return str(obj)
|
94
|
-
|
98
|
+
elif hasattr(obj, "isoformat"):
|
99
|
+
return obj.isoformat()
|
100
|
+
raise TypeError
|
101
|
+
|
95
102
|
|
103
|
+
def json_dumps(obj: t.Any) -> bytes:
|
104
|
+
"""
|
105
|
+
Serialize to JSON format, using `orjson`, with additional type support.
|
96
106
|
|
97
|
-
|
107
|
+
https://github.com/ijl/orjson
|
108
|
+
"""
|
98
109
|
return orjson.dumps(
|
99
110
|
obj,
|
100
111
|
default=cratedb_json_encoder,
|
101
|
-
option=orjson.OPT_SERIALIZE_NUMPY,
|
112
|
+
option=(orjson.OPT_NON_STR_KEYS | orjson.OPT_SERIALIZE_NUMPY),
|
102
113
|
)
|
103
114
|
|
104
115
|
|
@@ -318,7 +329,7 @@ def _update_pool_kwargs_for_ssl_minimum_version(server, kwargs):
|
|
318
329
|
kwargs["ssl_minimum_version"] = ssl.TLSVersion.MINIMUM_SUPPORTED
|
319
330
|
|
320
331
|
|
321
|
-
def _create_sql_payload(stmt, args, bulk_args):
|
332
|
+
def _create_sql_payload(stmt, args, bulk_args) -> bytes:
|
322
333
|
if not isinstance(stmt, str):
|
323
334
|
raise ValueError("stmt is not a string")
|
324
335
|
if args and bulk_args:
|
@@ -1,17 +1,17 @@
|
|
1
|
-
crate/client/__init__.py,sha256=
|
1
|
+
crate/client/__init__.py,sha256=ApP2LvuWsycIceLILaXsUgyFR96CcOx7C7hI5OXEdtc,1349
|
2
2
|
crate/client/_pep440.py,sha256=iwY5wopxbgbwsT0ImANrwN3V_ZYQHhSr7lEdVT5dQRM,42
|
3
3
|
crate/client/blob.py,sha256=aMo6ZNHGT3Zq_yR3gcpd3CKrJvfqUAhExhKtHUwC5Io,3460
|
4
4
|
crate/client/connection.py,sha256=80v9_--YilDAaIQpejf3G_TWGz9iwUkixwHAL66sDm0,8098
|
5
5
|
crate/client/converter.py,sha256=Qci0MNcpz1jAnjquG8Ld9LI84_iHVInrv4HMb8r5zzg,4313
|
6
6
|
crate/client/cursor.py,sha256=Mlk-TVLzM4zSSr7GxcHK4Mjbt1KQeMfNFNrPBtGjk-c,10741
|
7
7
|
crate/client/exceptions.py,sha256=wMyJmOB3RP5kuPeW9f0fEb-1AKZcGSTyIGvN0HqpqUw,2557
|
8
|
-
crate/client/http.py,sha256=
|
8
|
+
crate/client/http.py,sha256=b_EVzChq6FGQg4tNc-3fheUas9mybQJI4aMHKYVpGEU,22513
|
9
9
|
crate/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
crate/testing/layer.py,sha256=jvHRWTRE4Zal211UO0HWPFcbprAcaGB3WyAUDR7BKFQ,13376
|
11
11
|
crate/testing/util.py,sha256=BPEZ8DavXwyOTCmOQnP5QjQlapEw3harzKK4w2HOTA4,3264
|
12
|
-
crate-2.0.0.
|
13
|
-
crate-2.0.0.
|
14
|
-
crate-2.0.0.
|
15
|
-
crate-2.0.0.
|
16
|
-
crate-2.0.0.
|
17
|
-
crate-2.0.0.
|
12
|
+
crate-2.0.0.dev5.dist-info/LICENSE,sha256=s_w3FXmAYQuatqsgvyYLnGyC_13KOqp3W1DUEXO9RpY,10175
|
13
|
+
crate-2.0.0.dev5.dist-info/METADATA,sha256=GpJuX0mupTBanwtxvK3MJhMYRAyhdnhl48NtkeCPNsw,5655
|
14
|
+
crate-2.0.0.dev5.dist-info/NOTICE,sha256=jfWOHkoZKjNATGXMfgpMJdL38ki_ZZTgR6M9CUUJxrM,1159
|
15
|
+
crate-2.0.0.dev5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
16
|
+
crate-2.0.0.dev5.dist-info/top_level.txt,sha256=2wP2HlpxdhgTLMl9ipi168xkm6FMq9_2bf0xGGxF_OI,6
|
17
|
+
crate-2.0.0.dev5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|