Skip to content

Commit

Permalink
Merge pull request #883 from materialsproject/bugfix/hint_scheme_changes
Browse files Browse the repository at this point in the history
Update hint_scheme
  • Loading branch information
Jason Munro authored Nov 7, 2023
2 parents 86a161e + 5d50d93 commit 73f10f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/maggma/api/resource/read_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,8 @@ def search(**queries: Dict[str, STORE_PARAMS]) -> Union[Dict, Response]:

try:
with query_timeout(self.timeout):
count = self.store.count( # type: ignore
**{field: query[field] for field in query if field in ["criteria", "hint"]}
)

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

if isinstance(self.store, S3Store):
if self.query_disk_use:
Expand All @@ -241,7 +240,7 @@ def search(**queries: Dict[str, STORE_PARAMS]) -> Union[Dict, Response]:
data = list(
self.store._collection.aggregate(
pipeline,
**{field: query[field] for field in query if field in ["hint"]},
hint = query.get("agg_hint"),
)
)

Expand Down
3 changes: 2 additions & 1 deletion src/maggma/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"limit",
"request",
"pipeline",
"hint",
"count_hint",
"agg_hint",
"update",
],
Any,
Expand Down

0 comments on commit 73f10f5

Please sign in to comment.