Bug #7166
open
[API] specifying an invalid filter should result in an error
Added by Ward Vandewege over 9 years ago.
Updated over 3 years ago.
Description
This invalid filter
api_client.collections().list(filters=[['portable_data_hash', 'somepdhoranother+size']], select=['portable_data_hash', 'uuid'], limit=100000).execute()
is simply ignored; the query above returns all collections. Our SDK should probably throw an exception - or at least print a warning when an invalid filter is ignored.
api_client.collections().list(filters=[['portable_data_hash', '=', 'somepdhoranother+size']], select=['portable_data_hash', 'uuid'], limit=100000).execute()
the above filter is correct and works as expected.
- Description updated (diff)
- Description updated (diff)
- Subject changed from [SDKs] specifying an invalid filter should result in an error to [API] specifying an invalid filter should result in an error
Certain kinds of specific invalid filters will cause the API server to raise an exception and return 422. See all the raise ArgumentError
in src:/services/api/lib/record_filters.rb. I think we probably want to extend that behavior to all kinds of invalid filters.
I notice that there is no default case to handle unknown operators. That's why the first case is being silently ignored: it doesn't recognize the PDH as an operator, so it just ignores the filter.
- Target version changed from Bug Triage to Arvados Future Sprints
- Description updated (diff)
The related tickets have examples of other filters that should've returned errors, but were silently ignored. #8866: Parameter was not URL-encoded, so it looked funny after Rails parsed. it. #9230: Filter used ==
instead of =
as the operator.
- Target version deleted (
Arvados Future Sprints)
Also available in: Atom
PDF