Bug #6992

[API] Support numeric filter comparisons for numeric fields

Added by Brett Smith about 4 years ago. Updated about 4 years ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
API
Target version:
Start date:
08/14/2015
Due date:
% Done:

0%

Estimated time:
Story points:
-

Description

I expected this to work:

>>> arvados.util.list_all(arv.job_tasks().list, filters=[['sequence', '>', 0]])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/arvados/util.py", line 370, in list_all
    c = fn(offset=offset, **kwargs).execute(num_retries=num_retries)
  File "/usr/local/lib/python2.7/dist-packages/oauth2client/util.py", line 137, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/googleapiclient/http.py", line 729, in execute
    raise HttpError(resp, content, uri=self.uri)
arvados.errors.ApiError: <HttpError 422 when requesting https://su92l.arvadosapi.com/arvados/v1/job_tasks?alt=json&filters=%5B%5B%22sequence%22%2C+%22%3E%22%2C+0%5D%5D&offset=0 returned "#<ArgumentError: Invalid operand type 'Fixnum' for '>' operator in filters>">

It seems to work if I filter on 'sequence', '>', '0', but I wonder if that's based on string lexicographic ordering.

I think I should be able to use a numeric operand when applying these filters to numeric types. Discussing it in IRC, Ward and Tom seemed to expect the same as well.

Also available in: Atom PDF