Skip to content
Snippets Groups Projects
Commit 5e7c0403 authored by Yuli Liu's avatar Yuli Liu
Browse files

""

parent 4d2e88c2
No related branches found
No related tags found
1 merge request!291initiate filtering capabilities
Pipeline #77691 failed
......@@ -14,7 +14,7 @@ def parse_filter(col_filter: str) -> Tuple[str,str,str]:
expression should be in the form <column_name>:<operator>:<value>
>>> parse_filter('A:eq')
Exception: Invalid filter expression A:eq
FilterError: Invalid filter expression A:eq
>>> parse_filter('A:eq:2')
('A', 'eq', '2')
"""
......@@ -30,11 +30,11 @@ def get_parsed_filters(bulk_filter: List[str]) -> dict:
>>> get_parsed_filters(['A:lt:2', 'B:lt:2', 'A:gt:3'])
{'a': {'lt': '2', 'gt': '3'}, 'b': {'lt': '2'}}
>>> get_parsed_filters(['A'])
Exception: Invalid filter expression A
FilterError: Invalid filter expression A
>>> get_parsed_filters(['A:=:2'])
Exception: Operator = is not supported
FilterError: Operator = is not supported
>>> get_parsed_filters(['A:eq:2', 'A:eq:3'])
Exception: Same operator on the same column
FilterError: Same operator on the same column
"""
filter_dict = {}
for col_name, operator, value in (parse_filter(f) for f in bulk_filter):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment