hubmap-search-sdk 1.0.0a4__py3-none-any.whl → 1.0.0a6__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.
- hubmap_search_sdk/_base_client.py +40 -2
- hubmap_search_sdk/_models.py +0 -1
- hubmap_search_sdk/_utils/_typing.py +1 -1
- hubmap_search_sdk/_version.py +1 -1
- {hubmap_search_sdk-1.0.0a4.dist-info → hubmap_search_sdk-1.0.0a6.dist-info}/METADATA +1 -1
- {hubmap_search_sdk-1.0.0a4.dist-info → hubmap_search_sdk-1.0.0a6.dist-info}/RECORD +8 -8
- {hubmap_search_sdk-1.0.0a4.dist-info → hubmap_search_sdk-1.0.0a6.dist-info}/WHEEL +0 -0
- {hubmap_search_sdk-1.0.0a4.dist-info → hubmap_search_sdk-1.0.0a6.dist-info}/licenses/LICENSE +0 -0
@@ -98,7 +98,11 @@ _StreamT = TypeVar("_StreamT", bound=Stream[Any])
|
|
98
98
|
_AsyncStreamT = TypeVar("_AsyncStreamT", bound=AsyncStream[Any])
|
99
99
|
|
100
100
|
if TYPE_CHECKING:
|
101
|
-
from httpx._config import
|
101
|
+
from httpx._config import (
|
102
|
+
DEFAULT_TIMEOUT_CONFIG, # pyright: ignore[reportPrivateImportUsage]
|
103
|
+
)
|
104
|
+
|
105
|
+
HTTPX_DEFAULT_TIMEOUT = DEFAULT_TIMEOUT_CONFIG
|
102
106
|
else:
|
103
107
|
try:
|
104
108
|
from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT
|
@@ -115,6 +119,7 @@ class PageInfo:
|
|
115
119
|
|
116
120
|
url: URL | NotGiven
|
117
121
|
params: Query | NotGiven
|
122
|
+
json: Body | NotGiven
|
118
123
|
|
119
124
|
@overload
|
120
125
|
def __init__(
|
@@ -130,19 +135,30 @@ class PageInfo:
|
|
130
135
|
params: Query,
|
131
136
|
) -> None: ...
|
132
137
|
|
138
|
+
@overload
|
139
|
+
def __init__(
|
140
|
+
self,
|
141
|
+
*,
|
142
|
+
json: Body,
|
143
|
+
) -> None: ...
|
144
|
+
|
133
145
|
def __init__(
|
134
146
|
self,
|
135
147
|
*,
|
136
148
|
url: URL | NotGiven = NOT_GIVEN,
|
149
|
+
json: Body | NotGiven = NOT_GIVEN,
|
137
150
|
params: Query | NotGiven = NOT_GIVEN,
|
138
151
|
) -> None:
|
139
152
|
self.url = url
|
153
|
+
self.json = json
|
140
154
|
self.params = params
|
141
155
|
|
142
156
|
@override
|
143
157
|
def __repr__(self) -> str:
|
144
158
|
if self.url:
|
145
159
|
return f"{self.__class__.__name__}(url={self.url})"
|
160
|
+
if self.json:
|
161
|
+
return f"{self.__class__.__name__}(json={self.json})"
|
146
162
|
return f"{self.__class__.__name__}(params={self.params})"
|
147
163
|
|
148
164
|
|
@@ -191,6 +207,19 @@ class BasePage(GenericModel, Generic[_T]):
|
|
191
207
|
options.url = str(url)
|
192
208
|
return options
|
193
209
|
|
210
|
+
if not isinstance(info.json, NotGiven):
|
211
|
+
if not is_mapping(info.json):
|
212
|
+
raise TypeError("Pagination is only supported with mappings")
|
213
|
+
|
214
|
+
if not options.json_data:
|
215
|
+
options.json_data = {**info.json}
|
216
|
+
else:
|
217
|
+
if not is_mapping(options.json_data):
|
218
|
+
raise TypeError("Pagination is only supported with mappings")
|
219
|
+
|
220
|
+
options.json_data = {**options.json_data, **info.json}
|
221
|
+
return options
|
222
|
+
|
194
223
|
raise ValueError("Unexpected PageInfo state")
|
195
224
|
|
196
225
|
|
@@ -409,7 +438,8 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
409
438
|
|
410
439
|
idempotency_header = self._idempotency_header
|
411
440
|
if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers:
|
412
|
-
|
441
|
+
options.idempotency_key = options.idempotency_key or self._idempotency_key()
|
442
|
+
headers[idempotency_header] = options.idempotency_key
|
413
443
|
|
414
444
|
# Don't set these headers if they were already set or removed by the caller. We check
|
415
445
|
# `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case.
|
@@ -946,6 +976,10 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
946
976
|
request = self._build_request(options, retries_taken=retries_taken)
|
947
977
|
self._prepare_request(request)
|
948
978
|
|
979
|
+
if options.idempotency_key:
|
980
|
+
# ensure the idempotency key is reused between requests
|
981
|
+
input_options.idempotency_key = options.idempotency_key
|
982
|
+
|
949
983
|
kwargs: HttpxSendArgs = {}
|
950
984
|
if self.custom_auth is not None:
|
951
985
|
kwargs["auth"] = self.custom_auth
|
@@ -1487,6 +1521,10 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
1487
1521
|
request = self._build_request(options, retries_taken=retries_taken)
|
1488
1522
|
await self._prepare_request(request)
|
1489
1523
|
|
1524
|
+
if options.idempotency_key:
|
1525
|
+
# ensure the idempotency key is reused between requests
|
1526
|
+
input_options.idempotency_key = options.idempotency_key
|
1527
|
+
|
1490
1528
|
kwargs: HttpxSendArgs = {}
|
1491
1529
|
if self.custom_auth is not None:
|
1492
1530
|
kwargs["auth"] = self.custom_auth
|
hubmap_search_sdk/_models.py
CHANGED
@@ -110,7 +110,7 @@ def extract_type_var_from_base(
|
|
110
110
|
```
|
111
111
|
"""
|
112
112
|
cls = cast(object, get_origin(typ) or typ)
|
113
|
-
if cls in generic_bases:
|
113
|
+
if cls in generic_bases: # pyright: ignore[reportUnnecessaryContains]
|
114
114
|
# we're given the class directly
|
115
115
|
return extract_type_arg(typ, index)
|
116
116
|
|
hubmap_search_sdk/_version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: hubmap_search_sdk
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.0a6
|
4
4
|
Summary: The official Python library for the hubmap-search-sdk API
|
5
5
|
Project-URL: Homepage, https://github.com/hubmapconsortium/search-python-sdk
|
6
6
|
Project-URL: Repository, https://github.com/hubmapconsortium/search-python-sdk
|
@@ -1,17 +1,17 @@
|
|
1
1
|
hubmap_search_sdk/__init__.py,sha256=eUNBFfdHquxHRjxdtY6YQ0pw-jeQuVT7fm5mtYzB8hY,2545
|
2
|
-
hubmap_search_sdk/_base_client.py,sha256=
|
2
|
+
hubmap_search_sdk/_base_client.py,sha256=1RF00QWO49UDc_IWrsy44ksRIs9IY1xJ6PZ_r4EMq_4,66834
|
3
3
|
hubmap_search_sdk/_client.py,sha256=_B5lY2StPqLRgECImsspnws_3o0WbTfeMwZvhZTLRfo,19485
|
4
4
|
hubmap_search_sdk/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
|
5
5
|
hubmap_search_sdk/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
|
6
6
|
hubmap_search_sdk/_exceptions.py,sha256=TSu_vsDWiUzuD0Dfn2RJxjxeGl4RJBR2Sblmd-0cGho,3238
|
7
7
|
hubmap_search_sdk/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
|
8
|
-
hubmap_search_sdk/_models.py,sha256=
|
8
|
+
hubmap_search_sdk/_models.py,sha256=q-l1tes71l6z-D5ffu9-G4UigTVVeJwiwIzA_gO4RFo,29045
|
9
9
|
hubmap_search_sdk/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
|
10
10
|
hubmap_search_sdk/_resource.py,sha256=z9CsPEtCJP9np1GfCrGKkqUmlGd10QdY9ZtINq4vyIs,1154
|
11
11
|
hubmap_search_sdk/_response.py,sha256=V9jyjwgBvmdB9MqltIZFs4gLcdbj1MmLdhwS-ILkBSk,28881
|
12
12
|
hubmap_search_sdk/_streaming.py,sha256=Anm1GDFtbRi3IL4NaaajTXDlwv75_Rm-bi6TD_0tSxU,10136
|
13
13
|
hubmap_search_sdk/_types.py,sha256=Xxqpn7vIdO1HG3-TJaQdHFEI1etNZxdSS3QOOeakw0A,6154
|
14
|
-
hubmap_search_sdk/_version.py,sha256=
|
14
|
+
hubmap_search_sdk/_version.py,sha256=YKtL7InDmy5Rszgk7kf-NQ_QF-cHcWsjvspK_V5MDpk,177
|
15
15
|
hubmap_search_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
hubmap_search_sdk/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
|
17
17
|
hubmap_search_sdk/_utils/_logs.py,sha256=vEolshfk2D36E9yV2JC0vIbMfBmiM-lIAw-ledyLVVI,807
|
@@ -20,7 +20,7 @@ hubmap_search_sdk/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1
|
|
20
20
|
hubmap_search_sdk/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
|
21
21
|
hubmap_search_sdk/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
|
22
22
|
hubmap_search_sdk/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,15617
|
23
|
-
hubmap_search_sdk/_utils/_typing.py,sha256=
|
23
|
+
hubmap_search_sdk/_utils/_typing.py,sha256=D0DbbNu8GnYQTSICnTSHDGsYXj8TcAKyhejb0XcnjtY,4602
|
24
24
|
hubmap_search_sdk/_utils/_utils.py,sha256=8UmbPOy_AAr2uUjjFui-VZSrVBHRj6bfNEKRp5YZP2A,12004
|
25
25
|
hubmap_search_sdk/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
26
26
|
hubmap_search_sdk/resources/__init__.py,sha256=in53qeBTsjQ4j4Gy2lRL9ptQbjduHnnROAmu6IbragQ,4761
|
@@ -48,7 +48,7 @@ hubmap_search_sdk/types/search_execute_query_params.py,sha256=La2udYbqLYPTzIRJtt
|
|
48
48
|
hubmap_search_sdk/types/update_update_document_at_index_params.py,sha256=F6bL-5xzqfI1ClajCan9M2pWhKyP2qFENNXHE1unj54,341
|
49
49
|
hubmap_search_sdk/types/update_update_document_params.py,sha256=LM65ha6n6USOen2DqlL8R0N8APX9uAduWzqReXqJWOI,302
|
50
50
|
hubmap_search_sdk/types/update_update_document_with_scope_params.py,sha256=3Se48DT25C8gP_yvEoYWMg0whAD9qWPWMQH1rpvg8Zc,371
|
51
|
-
hubmap_search_sdk-1.0.
|
52
|
-
hubmap_search_sdk-1.0.
|
53
|
-
hubmap_search_sdk-1.0.
|
54
|
-
hubmap_search_sdk-1.0.
|
51
|
+
hubmap_search_sdk-1.0.0a6.dist-info/METADATA,sha256=1Jtlnr6BVfoXcrGKLY_FS2vh_deuoTAroBb_Duocgh0,12669
|
52
|
+
hubmap_search_sdk-1.0.0a6.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
53
|
+
hubmap_search_sdk-1.0.0a6.dist-info/licenses/LICENSE,sha256=lLxIB8m5gVPdScdg81tBYiNbRkVgIBWcmAN1yJwrOME,1057
|
54
|
+
hubmap_search_sdk-1.0.0a6.dist-info/RECORD,,
|
File without changes
|
{hubmap_search_sdk-1.0.0a4.dist-info → hubmap_search_sdk-1.0.0a6.dist-info}/licenses/LICENSE
RENAMED
File without changes
|