-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add Boolean filters to the Data Explorer #2949
Conversation
0fdcaa1
to
f444e43
Compare
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.
LGTM!
conditionEntries.push(new DropDownListBoxItem({ | ||
identifier: RowFilterDescrType.IS_TRUE, | ||
title: localize( | ||
'positron.addEditRowFilter.conditionIsTrue', | ||
"is true" | ||
), | ||
value: RowFilterDescrType.IS_TRUE | ||
})); |
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.
The fact these are all the same makes me wonder if a new class could be made for each condition ala how ContextKeyExpression
works.
E.g.
export class DropDownListBoxTrue extends DropDownListBoxItem<RowFilterDescrType.IS_TRUE, string> {
constructor() {
super(
{
identifier: RowFilterDescrType.IS_TRUE,
title: localize(
'positron.addEditRowFilter.conditionIsTrue',
"is true"
),
value: RowFilterDescrType.IS_TRUE
});
}
}
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.
Not super applicable to this PR though
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.
This whole file is chock full of code duplication. I did a little refactoring a week or two ago to reduce some of it, but it would be good to modularize and make the list of "what filters are supported for each type" more declarative / easier to edit and less ad hoc. Same with the row filter descriptor classes which feel more verbose than is needed
@nstrayer thanks for the review! |
Intent
Creates "is true" and "is false" filter types and supporting UI code. Part of #2372. Addresses #2946.
Approach
Update comm contract; add UI for true/false filters; implementation in Python.
QA Notes
"Is true" and "Is false" test for these exact values rather than "truthy" or "falsy" values (e.g. Null/NA should not be considered true or false).
There is a related bug (which I did not attempt to fix) in the Python backend: currently, a column must contain at least one missing value in order for it to be marked as a boolean. #2950