hubmap-search-sdk 1.0.0a2__tar.gz → 1.0.0a4__tar.gz
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-1.0.0a4/.release-please-manifest.json +3 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/CHANGELOG.md +24 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/PKG-INFO +1 -1
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/pyproject.toml +1 -1
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_transform.py +46 -1
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_typing.py +2 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_version.py +1 -1
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/test_client.py +1 -1
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/test_transform.py +20 -1
- hubmap_search_sdk-1.0.0a2/.release-please-manifest.json +0 -3
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/.gitignore +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/CONTRIBUTING.md +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/LICENSE +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/README.md +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/SECURITY.md +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/api.md +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/bin/check-release-environment +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/bin/publish-pypi +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/examples/.keep +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/mypy.ini +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/noxfile.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/release-please-config.json +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/requirements-dev.lock +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/requirements.lock +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/__init__.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_base_client.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_client.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_compat.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_constants.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_exceptions.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_files.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_models.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_qs.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_resource.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_response.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_streaming.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_types.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/__init__.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_logs.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_proxy.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_reflection.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_streams.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_sync.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_utils.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/lib/.keep +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/py.typed +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/__init__.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/add.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/clear_docs.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/indices.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/mapping.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/mget.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/param_search.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/reindex.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/scroll_search.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/search.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/update.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/__init__.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/add_create_document_params.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/add_create_document_with_index_params.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/add_update_document_with_scope_params.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/index_list_response.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/mget_retrieve_multiple_by_index_params.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/mget_retrieve_multiple_params.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/param_search_execute_params.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/scroll_search_create_params.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/search_execute_index_query_params.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/search_execute_query_params.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/update_update_document_at_index_params.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/update_update_document_params.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/update_update_document_with_scope_params.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/__init__.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/__init__.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/test_add.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/test_clear_docs.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/test_indices.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/test_mapping.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/test_mget.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/test_param_search.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/test_reindex.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/test_scroll_search.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/test_search.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/test_update.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/conftest.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/sample_file.txt +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/test_deepcopy.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/test_extract_files.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/test_files.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/test_models.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/test_qs.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/test_required_args.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/test_response.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/test_streaming.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/test_utils/test_proxy.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/test_utils/test_typing.py +0 -0
- {hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/utils.py +0 -0
@@ -1,5 +1,29 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.0.0-alpha.4 (2025-04-12)
|
4
|
+
|
5
|
+
Full Changelog: [v1.0.0-alpha.3...v1.0.0-alpha.4](https://github.com/hubmapconsortium/search-python-sdk/compare/v1.0.0-alpha.3...v1.0.0-alpha.4)
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
* **perf:** optimize some hot paths ([5212433](https://github.com/hubmapconsortium/search-python-sdk/commit/5212433093ec3d9cce2270a07d825a88c852bded))
|
10
|
+
* **perf:** skip traversing types for NotGiven values ([383d6b2](https://github.com/hubmapconsortium/search-python-sdk/commit/383d6b222bfa396b9b083027178c27c1fb057df6))
|
11
|
+
|
12
|
+
|
13
|
+
### Chores
|
14
|
+
|
15
|
+
* **internal:** expand CI branch coverage ([5cb57ca](https://github.com/hubmapconsortium/search-python-sdk/commit/5cb57ca2e66a71d85e638df9c377b2305a136c66))
|
16
|
+
* **internal:** reduce CI branch coverage ([3d69904](https://github.com/hubmapconsortium/search-python-sdk/commit/3d699046bc26aa7bebf84061cf0d34aee6e944c5))
|
17
|
+
|
18
|
+
## 1.0.0-alpha.3 (2025-04-09)
|
19
|
+
|
20
|
+
Full Changelog: [v1.0.0-alpha.2...v1.0.0-alpha.3](https://github.com/hubmapconsortium/search-python-sdk/compare/v1.0.0-alpha.2...v1.0.0-alpha.3)
|
21
|
+
|
22
|
+
### Chores
|
23
|
+
|
24
|
+
* **internal:** remove trailing character ([#20](https://github.com/hubmapconsortium/search-python-sdk/issues/20)) ([eba7907](https://github.com/hubmapconsortium/search-python-sdk/commit/eba7907ee5740d1280a2e8644505539d7e0f2bd2))
|
25
|
+
* **internal:** slight transform perf improvement ([#23](https://github.com/hubmapconsortium/search-python-sdk/issues/23)) ([4605f8b](https://github.com/hubmapconsortium/search-python-sdk/commit/4605f8b1836a291ab658811a196cb46a3df818b0))
|
26
|
+
|
3
27
|
## 1.0.0-alpha.2 (2025-04-03)
|
4
28
|
|
5
29
|
Full Changelog: [v1.0.0-alpha.1...v1.0.0-alpha.2](https://github.com/hubmapconsortium/search-python-sdk/compare/v1.0.0-alpha.1...v1.0.0-alpha.2)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: hubmap_search_sdk
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.0a4
|
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
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_transform.py
RENAMED
@@ -5,13 +5,15 @@ import base64
|
|
5
5
|
import pathlib
|
6
6
|
from typing import Any, Mapping, TypeVar, cast
|
7
7
|
from datetime import date, datetime
|
8
|
-
from typing_extensions import Literal, get_args, override, get_type_hints
|
8
|
+
from typing_extensions import Literal, get_args, override, get_type_hints as _get_type_hints
|
9
9
|
|
10
10
|
import anyio
|
11
11
|
import pydantic
|
12
12
|
|
13
13
|
from ._utils import (
|
14
14
|
is_list,
|
15
|
+
is_given,
|
16
|
+
lru_cache,
|
15
17
|
is_mapping,
|
16
18
|
is_iterable,
|
17
19
|
)
|
@@ -108,6 +110,7 @@ def transform(
|
|
108
110
|
return cast(_T, transformed)
|
109
111
|
|
110
112
|
|
113
|
+
@lru_cache(maxsize=8096)
|
111
114
|
def _get_annotated_type(type_: type) -> type | None:
|
112
115
|
"""If the given type is an `Annotated` type then it is returned, if not `None` is returned.
|
113
116
|
|
@@ -142,6 +145,10 @@ def _maybe_transform_key(key: str, type_: type) -> str:
|
|
142
145
|
return key
|
143
146
|
|
144
147
|
|
148
|
+
def _no_transform_needed(annotation: type) -> bool:
|
149
|
+
return annotation == float or annotation == int
|
150
|
+
|
151
|
+
|
145
152
|
def _transform_recursive(
|
146
153
|
data: object,
|
147
154
|
*,
|
@@ -184,6 +191,15 @@ def _transform_recursive(
|
|
184
191
|
return cast(object, data)
|
185
192
|
|
186
193
|
inner_type = extract_type_arg(stripped_type, 0)
|
194
|
+
if _no_transform_needed(inner_type):
|
195
|
+
# for some types there is no need to transform anything, so we can get a small
|
196
|
+
# perf boost from skipping that work.
|
197
|
+
#
|
198
|
+
# but we still need to convert to a list to ensure the data is json-serializable
|
199
|
+
if is_list(data):
|
200
|
+
return data
|
201
|
+
return list(data)
|
202
|
+
|
187
203
|
return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
|
188
204
|
|
189
205
|
if is_union_type(stripped_type):
|
@@ -245,6 +261,11 @@ def _transform_typeddict(
|
|
245
261
|
result: dict[str, object] = {}
|
246
262
|
annotations = get_type_hints(expected_type, include_extras=True)
|
247
263
|
for key, value in data.items():
|
264
|
+
if not is_given(value):
|
265
|
+
# we don't need to include `NotGiven` values here as they'll
|
266
|
+
# be stripped out before the request is sent anyway
|
267
|
+
continue
|
268
|
+
|
248
269
|
type_ = annotations.get(key)
|
249
270
|
if type_ is None:
|
250
271
|
# we do not have a type annotation for this field, leave it as is
|
@@ -332,6 +353,15 @@ async def _async_transform_recursive(
|
|
332
353
|
return cast(object, data)
|
333
354
|
|
334
355
|
inner_type = extract_type_arg(stripped_type, 0)
|
356
|
+
if _no_transform_needed(inner_type):
|
357
|
+
# for some types there is no need to transform anything, so we can get a small
|
358
|
+
# perf boost from skipping that work.
|
359
|
+
#
|
360
|
+
# but we still need to convert to a list to ensure the data is json-serializable
|
361
|
+
if is_list(data):
|
362
|
+
return data
|
363
|
+
return list(data)
|
364
|
+
|
335
365
|
return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
|
336
366
|
|
337
367
|
if is_union_type(stripped_type):
|
@@ -393,6 +423,11 @@ async def _async_transform_typeddict(
|
|
393
423
|
result: dict[str, object] = {}
|
394
424
|
annotations = get_type_hints(expected_type, include_extras=True)
|
395
425
|
for key, value in data.items():
|
426
|
+
if not is_given(value):
|
427
|
+
# we don't need to include `NotGiven` values here as they'll
|
428
|
+
# be stripped out before the request is sent anyway
|
429
|
+
continue
|
430
|
+
|
396
431
|
type_ = annotations.get(key)
|
397
432
|
if type_ is None:
|
398
433
|
# we do not have a type annotation for this field, leave it as is
|
@@ -400,3 +435,13 @@ async def _async_transform_typeddict(
|
|
400
435
|
else:
|
401
436
|
result[_maybe_transform_key(key, type_)] = await _async_transform_recursive(value, annotation=type_)
|
402
437
|
return result
|
438
|
+
|
439
|
+
|
440
|
+
@lru_cache(maxsize=8096)
|
441
|
+
def get_type_hints(
|
442
|
+
obj: Any,
|
443
|
+
globalns: dict[str, Any] | None = None,
|
444
|
+
localns: Mapping[str, Any] | None = None,
|
445
|
+
include_extras: bool = False,
|
446
|
+
) -> dict[str, Any]:
|
447
|
+
return _get_type_hints(obj, globalns=globalns, localns=localns, include_extras=include_extras)
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_typing.py
RENAMED
@@ -13,6 +13,7 @@ from typing_extensions import (
|
|
13
13
|
get_origin,
|
14
14
|
)
|
15
15
|
|
16
|
+
from ._utils import lru_cache
|
16
17
|
from .._types import InheritsGeneric
|
17
18
|
from .._compat import is_union as _is_union
|
18
19
|
|
@@ -66,6 +67,7 @@ def is_type_alias_type(tp: Any, /) -> TypeIs[typing_extensions.TypeAliasType]:
|
|
66
67
|
|
67
68
|
|
68
69
|
# Extracts T from Annotated[T, ...] or from Required[Annotated[T, ...]]
|
70
|
+
@lru_cache(maxsize=8096)
|
69
71
|
def strip_annotated_type(typ: type) -> type:
|
70
72
|
if is_required_type(typ) or is_annotated_type(typ):
|
71
73
|
return strip_annotated_type(cast(type, get_args(typ)[0]))
|
@@ -1637,7 +1637,7 @@ class TestAsyncHubmapSearchSDK:
|
|
1637
1637
|
import threading
|
1638
1638
|
|
1639
1639
|
from hubmap_search_sdk._utils import asyncify
|
1640
|
-
from hubmap_search_sdk._base_client import get_platform
|
1640
|
+
from hubmap_search_sdk._base_client import get_platform
|
1641
1641
|
|
1642
1642
|
async def test_main() -> None:
|
1643
1643
|
result = await asyncify(get_platform)()
|
@@ -8,7 +8,7 @@ from typing_extensions import Required, Annotated, TypedDict
|
|
8
8
|
|
9
9
|
import pytest
|
10
10
|
|
11
|
-
from hubmap_search_sdk._types import Base64FileInput
|
11
|
+
from hubmap_search_sdk._types import NOT_GIVEN, Base64FileInput
|
12
12
|
from hubmap_search_sdk._utils import (
|
13
13
|
PropertyInfo,
|
14
14
|
transform as _transform,
|
@@ -432,3 +432,22 @@ async def test_base64_file_input(use_async: bool) -> None:
|
|
432
432
|
assert await transform({"foo": io.BytesIO(b"Hello, world!")}, TypedDictBase64Input, use_async) == {
|
433
433
|
"foo": "SGVsbG8sIHdvcmxkIQ=="
|
434
434
|
} # type: ignore[comparison-overlap]
|
435
|
+
|
436
|
+
|
437
|
+
@parametrize
|
438
|
+
@pytest.mark.asyncio
|
439
|
+
async def test_transform_skipping(use_async: bool) -> None:
|
440
|
+
# lists of ints are left as-is
|
441
|
+
data = [1, 2, 3]
|
442
|
+
assert await transform(data, List[int], use_async) is data
|
443
|
+
|
444
|
+
# iterables of ints are converted to a list
|
445
|
+
data = iter([1, 2, 3])
|
446
|
+
assert await transform(data, Iterable[int], use_async) == [1, 2, 3]
|
447
|
+
|
448
|
+
|
449
|
+
@parametrize
|
450
|
+
@pytest.mark.asyncio
|
451
|
+
async def test_strips_notgiven(use_async: bool) -> None:
|
452
|
+
assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"}
|
453
|
+
assert await transform({"foo_bar": NOT_GIVEN}, Foo1, use_async) == {}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_base_client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_exceptions.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/__init__.py
RENAMED
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_logs.py
RENAMED
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_proxy.py
RENAMED
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_reflection.py
RENAMED
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_streams.py
RENAMED
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_sync.py
RENAMED
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/_utils/_utils.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/__init__.py
RENAMED
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/add.py
RENAMED
File without changes
|
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/indices.py
RENAMED
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/mapping.py
RENAMED
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/mget.py
RENAMED
File without changes
|
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/reindex.py
RENAMED
File without changes
|
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/search.py
RENAMED
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/resources/update.py
RENAMED
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/src/hubmap_search_sdk/types/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/test_clear_docs.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/test_param_search.py
RENAMED
File without changes
|
File without changes
|
{hubmap_search_sdk-1.0.0a2 → hubmap_search_sdk-1.0.0a4}/tests/api_resources/test_scroll_search.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|