tol-sdk 1.8.10__py3-none-any.whl → 1.8.11__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.
- tol/goat/client.py +1 -1
- tol/goat/goat_datasource.py +4 -13
- {tol_sdk-1.8.10.dist-info → tol_sdk-1.8.11.dist-info}/METADATA +1 -1
- {tol_sdk-1.8.10.dist-info → tol_sdk-1.8.11.dist-info}/RECORD +8 -8
- {tol_sdk-1.8.10.dist-info → tol_sdk-1.8.11.dist-info}/WHEEL +0 -0
- {tol_sdk-1.8.10.dist-info → tol_sdk-1.8.11.dist-info}/entry_points.txt +0 -0
- {tol_sdk-1.8.10.dist-info → tol_sdk-1.8.11.dist-info}/licenses/LICENSE +0 -0
- {tol_sdk-1.8.10.dist-info → tol_sdk-1.8.11.dist-info}/top_level.txt +0 -0
tol/goat/client.py
CHANGED
|
@@ -57,7 +57,7 @@ class GoatApiClient:
|
|
|
57
57
|
r.raise_for_status()
|
|
58
58
|
return r.json()['results'] if 'results' in r.json() else [], r.json()['status']['hits']
|
|
59
59
|
|
|
60
|
-
def __detail_url(self, object_type: str, object_ids: str) -> Tuple[str, Dict]:
|
|
60
|
+
def __detail_url(self, object_type: str, object_ids: list[str]) -> Tuple[str, Dict]:
|
|
61
61
|
obj_ids_str = ','.join(object_ids)
|
|
62
62
|
return self.__page_url(object_type, 1, len(object_ids), f'tax_name({obj_ids_str})')
|
|
63
63
|
|
tol/goat/goat_datasource.py
CHANGED
|
@@ -8,8 +8,6 @@ import typing
|
|
|
8
8
|
from functools import cache
|
|
9
9
|
from typing import Callable, Iterable, List, Optional
|
|
10
10
|
|
|
11
|
-
from more_itertools import seekable
|
|
12
|
-
|
|
13
11
|
from .client import GoatApiClient
|
|
14
12
|
from .converter import (
|
|
15
13
|
GoatApiConverter
|
|
@@ -113,27 +111,20 @@ class GoatDataSource(
|
|
|
113
111
|
def get_by_id(
|
|
114
112
|
self,
|
|
115
113
|
object_type: str,
|
|
116
|
-
object_ids: Iterable[str],
|
|
114
|
+
object_ids: Iterable[str | int],
|
|
117
115
|
**kwargs,
|
|
118
116
|
) -> Iterable[Optional[DataObject]]:
|
|
119
117
|
if object_type not in self.supported_types:
|
|
120
118
|
raise DataSourceError(f'{object_type} is not supported')
|
|
121
119
|
|
|
120
|
+
object_ids_str = [str(object_id) for object_id in object_ids]
|
|
122
121
|
client = self.__client_factory()
|
|
123
|
-
goat_response, _ = client.get_detail(object_type,
|
|
122
|
+
goat_response, _ = client.get_detail(object_type, object_ids_str)
|
|
124
123
|
goat_converter = self.__gc_factory()
|
|
125
124
|
|
|
126
125
|
converted_objects, _ = goat_converter.convert_list(goat_response) \
|
|
127
126
|
if goat_response is not None else ([], 0)
|
|
128
|
-
|
|
129
|
-
for id_ in object_ids:
|
|
130
|
-
seekable_objects.seek(0)
|
|
131
|
-
for obj in seekable_objects:
|
|
132
|
-
if obj.id == id_:
|
|
133
|
-
yield obj
|
|
134
|
-
break
|
|
135
|
-
else:
|
|
136
|
-
yield None
|
|
127
|
+
return self.sort_by_id(converted_objects, object_ids_str)
|
|
137
128
|
|
|
138
129
|
def get_list_page(
|
|
139
130
|
self,
|
|
@@ -218,11 +218,11 @@ tol/flows/converters/treeofsex_upload_to_treeofsex_attribute_converter.py,sha256
|
|
|
218
218
|
tol/gap/__init__.py,sha256=aI9h4IEKAd_qCqJayj0fpUDgAYQxy0d8xyBtiABP0xY,134
|
|
219
219
|
tol/gap/gap_datasource.py,sha256=SfBfJh1-2W5Kb5ABNRX7FBJVR8VuD096UQgZ2SKjI6A,3527
|
|
220
220
|
tol/goat/__init__.py,sha256=6e_Wss7QPo5LY0YhlZz9iXsFAD5txMhSlhT5APWqr6Q,190
|
|
221
|
-
tol/goat/client.py,sha256=
|
|
221
|
+
tol/goat/client.py,sha256=q8nqpqlkVplPqpN6EfnzkMXbOE_GJEZU4ImJKcrl6ko,3686
|
|
222
222
|
tol/goat/converter.py,sha256=jHUWoJxZOHKp63S45FZA5DbU0rdvoKDkF0hUtedqnvE,1114
|
|
223
223
|
tol/goat/factory.py,sha256=-SOz8VIb_Nljvx7VrLWAg-1CXel9w7wVKQnz9vyZSQo,2639
|
|
224
224
|
tol/goat/filter.py,sha256=J-Fj8O7MSp1O1pIQGMhcMuIQycjYAEx_0ecXYZ9WSqI,3013
|
|
225
|
-
tol/goat/goat_datasource.py,sha256=
|
|
225
|
+
tol/goat/goat_datasource.py,sha256=rADBYKiyteM8cW0RbG6s7vR5xnxF36NJ_Ogkou2VBZQ,5917
|
|
226
226
|
tol/goat/parser.py,sha256=552e0p4rFXBnL7FpJ4AAf2kpnPYsh2PfzmZ95-YOSX8,4039
|
|
227
227
|
tol/google_sheets/__init__.py,sha256=SDrDFfqkLFll0Y6MNFh2yuyyeIfDtFwK1XSnEpsLNgg,133
|
|
228
228
|
tol/google_sheets/google_sheet_datasource.py,sha256=UPhcOZv5IJ2s91M_2wPcL00hl5Bou6qCLNWMjXdNNiQ,6501
|
|
@@ -361,9 +361,9 @@ tol/validators/unique_whole_organisms.py,sha256=RdqA1GzIf3LTdrmNGGdxv0aW2udDY2P9
|
|
|
361
361
|
tol/validators/value_check.py,sha256=DdNx_B1gns01zgBg5N6Bwia46Aukw6MAteM-M37Kv1k,1122
|
|
362
362
|
tol/validators/interfaces/__init__.py,sha256=jtOxnwnwqV_29xjmmMcS_kvlt-pQiWwQYJn2YRP07_w,172
|
|
363
363
|
tol/validators/interfaces/condition_evaluator.py,sha256=nj8Cb8hi47OBy6OVNfeLhF-Pjwtr8MiOSymYL6hfVes,3766
|
|
364
|
-
tol_sdk-1.8.
|
|
365
|
-
tol_sdk-1.8.
|
|
366
|
-
tol_sdk-1.8.
|
|
367
|
-
tol_sdk-1.8.
|
|
368
|
-
tol_sdk-1.8.
|
|
369
|
-
tol_sdk-1.8.
|
|
364
|
+
tol_sdk-1.8.11.dist-info/licenses/LICENSE,sha256=RF9Jacy-9BpUAQQ20INhTgtaNBkmdTolYCHtrrkM2-8,1077
|
|
365
|
+
tol_sdk-1.8.11.dist-info/METADATA,sha256=qwTqwgW3IHEgw2e6nNAwg6uXKrYh4Doo3ZkLVlWFaT8,3143
|
|
366
|
+
tol_sdk-1.8.11.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
367
|
+
tol_sdk-1.8.11.dist-info/entry_points.txt,sha256=jH3HfTwxjzog7E3lq8CKpUWGIRY9FSXbyL6CpUmv6D0,36
|
|
368
|
+
tol_sdk-1.8.11.dist-info/top_level.txt,sha256=PwKMQLphyZNvagBoriVbl8uwHXQl8IC1niawVG0iXMM,10
|
|
369
|
+
tol_sdk-1.8.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|