-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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: boolean type into SQL 'in' operator #16107
Conversation
@@ -112,7 +112,7 @@ const ColumnButtonWrapper = styled.div` | |||
const checkboxGenerator = (d, onChange) => ( | |||
<CheckboxControl value={d} onChange={onChange} /> | |||
); | |||
const DATA_TYPES = ['STRING', 'NUMERIC', 'DATETIME']; | |||
const DATA_TYPES = ['STRING', 'NUMERIC', 'DATETIME', 'BOOLEAN']; |
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.
bycatch: added boolean type in the UI
Codecov Report
@@ Coverage Diff @@
## master #16107 +/- ##
==========================================
- Coverage 76.88% 76.62% -0.27%
==========================================
Files 995 995
Lines 52864 52892 +28
Branches 6712 6721 +9
==========================================
- Hits 40644 40528 -116
- Misses 11994 12139 +145
+ Partials 226 225 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@junlincc Ephemeral environment spinning up at http://34.212.23.106:8080. Credentials are |
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 with one non-blocking recommendation
>>> cast_to_boolean('False') | ||
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.
Nit: I would also add this as it seems to be missing
>>> cast_to_boolean('True')
True
Ephemeral environment shutdown and build artifacts deleted. |
🏷 2021.31 |
* fix: boolean type into SQL 'in' operator * fix ut * fix ut again * update url * remove blank line (cherry picked from commit bb1d8fe)
* fix: boolean type into SQL 'in' operator * fix ut * fix ut again * update url * remove blank line (cherry picked from commit bb1d8fe)
* fix: boolean type into SQL 'in' operator * fix ut * fix ut again * update url * remove blank line
* fix: boolean type into SQL 'in' operator * fix ut * fix ut again * update url * remove blank line (cherry picked from commit bb1d8fe)
* fix: boolean type into SQL 'in' operator * fix ut * fix ut again * update url * remove blank line
* fix: boolean type into SQL 'in' operator * fix ut * fix ut again * update url * remove blank line (cherry picked from commit bb1d8fe)
* fix: boolean type into SQL 'in' operator * fix ut * fix ut again * update url * remove blank line (cherry picked from commit dde34b0)
SUMMARY
closes: #16081
Currently, there is an issue with filters that handle boolean values. If the database engine does not provide boolean value implicit conversion, will cause the query to fail.
Imagine SQL:
the derived column(Calculated column in Superset) type is Boolean, and the operand is String('true')
This PR introduced a conversion when the column type is boolean and operand type also is boolean.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
boolean.value.into.in.operator.mov
TESTING INSTRUCTIONS
birth_names
datasetname: boolean_gender
SQL expression :
case when gender = 'boy' then True else False end
Data Type: Boolean
boolean_gender
into Group by control; select sum(num) into Metric; checkemit dashboard cross filters
; saved to new dashboardtest
boolean_gender
into Group by control; select sum(num) into Metric; checkemit dashboard cross filters
; saved to dashboardtest
test
true
orfalse
in treemap v2, then the table can be filtered.ADDITIONAL INFORMATION