-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
fix(explore): Incorrect conversion from simple bool filter to custom sql #21293
Conversation
@@ -66,10 +66,10 @@ export function optionLabel(opt) { | |||
return EMPTY_STRING; | |||
} | |||
if (opt === true) { | |||
return '<true>'; | |||
return '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.
Can we use the TRUE_STRING
and FALSE_STRING
constants?
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.
Done! Though now we'll have TRUE
instead of true
in the labels
@@ -28,9 +28,9 @@ describe('utils/common', () => { | |||
it('converts values as expected', () => { | |||
expect(optionFromValue(false)).toEqual({ | |||
value: false, | |||
label: '<false>', |
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.
Can we use the constants here as well?
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.
👍
Codecov Report
@@ Coverage Diff @@
## master #21293 +/- ##
=======================================
Coverage 66.42% 66.42%
=======================================
Files 1784 1784
Lines 68237 68237
Branches 7263 7263
=======================================
Hits 45328 45328
Misses 21040 21040
Partials 1869 1869
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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. I'm fine with applying a toLowerCase
here.
SUMMARY
This PR removes brackets around
true
andfalse
when automatically converting boolean simple adhoc filter to a custom sql filter.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
Screen.Recording.2022-09-01.at.15.07.52.mov
After:
Screen.Recording.2022-09-01.at.15.06.40.mov
TESTING INSTRUCTIONS
true
orfalse
and that query works correctlyADDITIONAL INFORMATION