Skip to content

Commit

Permalink
Update hint_scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason committed Nov 7, 2023
1 parent 86a161e commit 5d50d93
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
@@ -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:
@@ -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"),
)
)

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

0 comments on commit 5d50d93

Please sign in to comment.