-
Notifications
You must be signed in to change notification settings - Fork 539
Add support for filtering on boolean columns #11095
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
Conversation
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
if ui.re_radio_value(query, true, "true").clicked() | ||
|| ui.re_radio_value(query, false, "false").clicked() | ||
{ | ||
action = FilterUiAction::CommitStateToBlueprint; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be awesome if these could also have the syntax highlighting color
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's keep as TBD :)
Co-authored-by: Lucas Meurer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
( | ||
Filter { | ||
column_name: "string_list", | ||
operation: StringContains( | ||
"c", | ||
), | ||
}, | ||
RecordBatch { | ||
schema: Schema { | ||
fields: [ | ||
Field { | ||
name: "string_list", | ||
data_type: List( | ||
Field { | ||
name: "item", | ||
data_type: Utf8, | ||
nullable: false, | ||
dict_id: 0, | ||
dict_is_ordered: false, | ||
metadata: {}, | ||
}, | ||
), | ||
nullable: false, | ||
dict_id: 0, | ||
dict_is_ordered: false, | ||
metadata: {}, | ||
}, | ||
], | ||
metadata: {}, | ||
}, | ||
columns: [ | ||
ListArray | ||
[ | ||
StringArray | ||
[ | ||
"c", | ||
"ab", | ||
], | ||
StringArray | ||
[ | ||
"A B", | ||
"aBc", | ||
], | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, for boolean arrays, all values must match, while for string arrrays, it's enough if a single value matches? I feel like this is a bit unexpected. But on the other hand it makes sense, I guess. Eventually we should have an all
/any
toggle for arrays.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct, the semantics are not super consistent. TBH, i'm not expecting to see a whole lot of list of bool with more than a single one, so it's probably not a huge deal. But we definitely need to review/design the semantics of all of these, and make sure the UI is consistent.
FWIW, I'm about to introduce a 3rd semantics for scalar: only consider the 1st element 😬 (because I'm not sure how to deal with [1, 2, 3] > 3
but we must deal with [1] > 3
because that's how our properties are typed.
cc @pweids
Related
What
Bool and List[Bool] column can now be filtered by
is true/false
. For List[Bool], all instances must be equal to the query value.Added a bunch of test for the filter themselves.
This PR also goes all in on the "semantic" syntax highlighting, which does raise some questions/inconsistencies. We will likely need to: