Skip to content

Commit

Permalink
Merge pull request #888 from materialsproject/bugfix/s3_count_hint
Browse files Browse the repository at this point in the history
Remove hint in count for S3Store
  • Loading branch information
Jason Munro authored Nov 16, 2023
2 parents bcbe290 + 7337801 commit 01dee3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/maggma/api/resource/read_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,16 @@ def search(**queries: Dict[str, STORE_PARAMS]) -> Union[Dict, Response]:
try:
with query_timeout(self.timeout):

count = self.store.count(criteria = query.get("criteria"), hint = query.get("count_hint")) # type: ignore

if isinstance(self.store, S3Store):
count = self.store.count(criteria = query.get("criteria")) # type: ignore

if self.query_disk_use:
data = list(self.store.query(**query, allow_disk_use=True)) # type: ignore
else:
data = list(self.store.query(**query))
else:
count = self.store.count(criteria = query.get("criteria"), hint = query.get("count_hint")) # type: ignore

pipeline = generate_query_pipeline(query, self.store)

agg_kwargs = {}
Expand Down

0 comments on commit 01dee3d

Please sign in to comment.