Skip to content

Commit

Permalink
Remove hint in count for S3Store
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason committed Nov 16, 2023
1 parent bcbe290 commit 7337801
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

Check warning on line 231 in src/maggma/api/resource/read_resource.py

View check run for this annotation

Codecov / codecov/patch

src/maggma/api/resource/read_resource.py#L231

Added line #L231 was not covered by tests

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 7337801

Please sign in to comment.