Project

General

Profile

Actions

Bug #7166

open

[API] specifying an invalid filter should result in an error

Added by Ward Vandewege over 8 years ago. Updated about 2 months ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
-
Target version:
Story points:
-
Release:
Release relationship:
Auto

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.


Related issues

Has duplicate Arvados - Bug #9230: illegal filters return 0 results rather than indicating an errorDuplicate05/18/2016Actions
Has duplicate Arvados - Bug #8866: [API] 0 items found when requesting a list with filters that aren't URL-encodedDuplicate04/01/2016Actions
Actions #1

Updated by Ward Vandewege over 8 years ago

  • Description updated (diff)
Actions #2

Updated by Ward Vandewege over 8 years ago

  • Description updated (diff)
Actions #3

Updated by Brett Smith over 8 years ago

  • 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.

Actions #4

Updated by Brett Smith over 8 years ago

  • Target version changed from Bug Triage to Arvados Future Sprints
Actions #5

Updated by Brett Smith almost 8 years ago

  • Description updated (diff)
Actions #6

Updated by Brett Smith almost 8 years ago

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.

Actions #7

Updated by Ward Vandewege almost 3 years ago

  • Target version deleted (Arvados Future Sprints)
Actions #8

Updated by Peter Amstutz about 1 year ago

  • Release set to 60
Actions #9

Updated by Peter Amstutz about 2 months ago

  • Target version set to Future
Actions

Also available in: Atom PDF