Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forbid empty list and None values in attribute_filters #2202

Merged
merged 15 commits into from
Jan 22, 2025
Prev Previous commit
Next Next commit
remove None case from validator
  • Loading branch information
ychiucco committed Jan 22, 2025
commit 30671bbbb7875e1caacbab2e2947b8aac016db86
6 changes: 1 addition & 5 deletions fractal_server/app/schemas/_filter_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ def validate_attribute_filters(

attribute_filters = valdict_keys("attribute_filters")(attribute_filters)
for key, values in attribute_filters.items():
if values is None:
# values=None corresponds to not applying any filter for
# attribute `key`
pass
elif values == []:
if values == []:
raise ValueError(
f"attribute_filters[{key}] cannot be an empty list."
)
Expand Down
Loading