Skip to content

Commit

Permalink
[pycue] Fix typeError on criterion search (#1422)
Browse files Browse the repository at this point in the history
* Fix typeError on criterion search

Searching with a criterion gt or lt returned `TypeError: No positional arguments allowed`. Grpc objects don't accept position arguments.

Signed-off-by: Diego Tavares <[email protected]>

---------

Signed-off-by: Diego Tavares <[email protected]>
  • Loading branch information
DiegoTavares authored Jul 17, 2024
1 parent 9680b4f commit 340a713
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pycue/opencue/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,12 @@ def _convert(val):
if search.startswith("gt"):
criterion = getattr(criterion_pb2,
"GreaterThan%sSearchCriterion" % searchTypeStr)
return criterion(_convert(search[2:]))
return criterion(value=_convert(search[2:]))

if search.startswith("lt"):
criterion = getattr(criterion_pb2,
"LessThan%sSearchCriterion" % searchTypeStr)
return criterion(_convert(search[2:]))
return criterion(value=_convert(int(search[2:])))

if search.find("-") > -1:
criterion = getattr(criterion_pb2,
Expand Down

0 comments on commit 340a713

Please sign in to comment.