-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
[explore, PostgreSQL] filter values not correctly displayed for boolean columns #3007
Comments
Some debugging: Talking about superset/connectors/sqla/models.py, around line 454. The values and dtypes of the filter values col, op and eq are as follows, when a filter on a boolean column is applied:
So, as observed in the query results, the values are handled correctly. |
@mistercrunch, @xrmx: Could anyone of you give me a hint, please? I actually don't know where to start digging. |
Notice: this issue has been closed because it has been inactive for 281 days. Feel free to comment and request for this issue to be reopened. |
@mistercrunch please reopen. |
This should actually be fixed since #4651 |
I've the same issue |
I'm having the same issue but with mssql DB. |
Hi, |
yeah same on presto for 0.37 |
I mentioned this behavior in #2814 but since this is a Postgres-specific issue, I guess it's best to file a new issue.
Superset version
0.18.4 in combination with Postgres as DB backend
Expected results
The drop down selector shows both existing states (false/true or 0/1) of a boolean column, allowing to select the value to be filtered on — assuming that the column actually features both states.
Actual results
In both kinds of filtering mechanisms — within a filter slice and using filters on the explore page — the drop-down selector for the boolean column shows two rows, however, they are both not labeled.
Selecting either of them results in the corresponding filters on false or true applied, though.
So it seems that this is only an issue regarding the representation of the column values.
The following picture depicts the empty label string that is yielded if any of the values is selected for filtering.
When doing the same with an SQLite backend, the drop-down list is correctly populated with 0 and 1.
I got the idea that the difference between SQLite's and Postgres' boolean types is that the former uses 0 and 1 as representation, while the latter employs false and true. So maybe it's all about casting these values to the strings that get printed in the selector list.
Steps to reproduce
For simplicity, we just employ the data stored in superset's management DB, which we assume to be running on Prostgres:
active
column filterableThe text was updated successfully, but these errors were encountered: