Skip to content

Commit 8c1f6d1

Browse files
committed
auto-fallback on db if s3 not avail
1 parent 6de5199 commit 8c1f6d1

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

mp_api/client/core/client.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,6 @@ def _query_resource(
468468
}
469469
)
470470
and num_chunks is None
471-
and "substrates" not in self.suffix
472-
and "phonon" not in self.suffix
473471
)
474472

475473
if fields:
@@ -506,11 +504,22 @@ def _query_resource(
506504

507505
keys = []
508506
for page in pages:
509-
for obj in page["Contents"]:
507+
for obj in page.get("Contents", []):
510508
key = obj.get("Key")
511509
if key:
512510
keys.append(key)
513511

512+
if len(keys) < 1:
513+
self._submit_requests(
514+
url=url,
515+
criteria=criteria,
516+
use_document_model=use_document_model,
517+
parallel_param=parallel_param,
518+
num_chunks=num_chunks,
519+
chunk_size=chunk_size,
520+
timeout=timeout,
521+
)
522+
514523
decoder = (
515524
MontyDecoder().decode if self.monty_decode else json_util.loads
516525
)

0 commit comments

Comments
 (0)