Skip to content

Commit bb0c8a9

Browse files
add settings back in
1 parent dcda4f6 commit bb0c8a9

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

mp_api/client/core/client.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -534,15 +534,14 @@ def _query_resource(
534534
else None
535535
)
536536

537-
byte_data = self._multi_thread(
538-
self._query_open_data,
539-
list(s3_params_list.values()),
540-
pbar, # type: ignore
541-
)
542-
543-
unzipped_chunks = []
544-
for docs, _, _ in byte_data:
545-
unzipped_chunks.append(docs)
537+
unzipped_chunks = [
538+
docs
539+
for docs, _, _ in self._multi_thread(
540+
self._query_open_data,
541+
list(s3_params_list.values()),
542+
pbar, # type: ignore
543+
)
544+
]
546545

547546
data = {
548547
"data": list(chain.from_iterable(unzipped_chunks)),

mp_api/client/core/settings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from mp_api.client import __file__ as root_dir
99

1010
PMG_SETTINGS = _load_pmg_settings()
11+
_NUM_PARALLEL_REQUESTS = min(PMG_SETTINGS.get("MPRESTER_NUM_PARALLEL_REQUESTS", 4), 4)
1112
_MAX_RETRIES = min(PMG_SETTINGS.get("MPRESTER_MAX_RETRIES", 3), 3)
1213
_MUTE_PROGRESS_BAR = PMG_SETTINGS.get("MPRESTER_MUTE_PROGRESS_BARS", False)
1314
_MAX_LIST_LENGTH = min(PMG_SETTINGS.get("MPRESTER_MAX_LIST_LENGTH", 10000), 10000)
@@ -26,6 +27,11 @@ class MAPIClientSettings(BaseSettings):
2627
description="Directory with test files",
2728
)
2829

30+
NUM_PARALLEL_REQUESTS: int = Field(
31+
_NUM_PARALLEL_REQUESTS,
32+
description="Number of parallel requests to send.",
33+
)
34+
2935
MAX_RETRIES: int = Field(
3036
_MAX_RETRIES, description="Maximum number of retries for requests."
3137
)

0 commit comments

Comments
 (0)