-
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
Confusion between python False/True
and sql false/true
in dashboard filters
#30391
Comments
Hey there, @kraftaa! I'm here to help you with any bugs, questions, or contributions you have for Superset. Let's work together to solve the issue you're facing. To resolve the issue of Here is an example of how you can use import { getDataRecordFormatter, GenericDataType } from 'src/filters/utils';
import { TRUE_STRING, FALSE_STRING } from 'src/utils/common';
const formatter = getDataRecordFormatter();
// Example usage:
const formattedValue1 = formatter('true', GenericDataType.Boolean); // returns TRUE_STRING
const formattedValue2 = formatter('False', GenericDataType.Boolean); // returns FALSE_STRING
const formattedValue3 = formatter(true, GenericDataType.Boolean); // returns TRUE_STRING
const formattedValue4 = formatter(false, GenericDataType.Boolean); // returns FALSE_STRING
console.log(formattedValue1); // "true"
console.log(formattedValue2); // "false"
console.log(formattedValue3); // "true"
console.log(formattedValue4); // "false" By using this formatter, you can ensure that all boolean values in the |
hi, thank you. |
To use the
By following these steps, you can ensure that the boolean values in your |
thank you. |
Bug description
I'm running Superset in kubernetes via helm chart.
I have a postgres table with such a definition
I've added values there
Then I'm looking in
sql lab
and see thatfinal_value
is converted to Python booleanI'm looking at the dashboard and seeing
False/True
infinal_value
columnIf I select another filter it'll show
false/true
notFalse/True
infinal_value
columnFor now the value is Jsonb and it won't work with the filter
so I'm adding to the dataset (to be able to use IN and LIKE )
How to reproduce the bug
go to the dataset, choose
False
in and see No data returned, because there is notFalse/True
in this columnIf I type for
like
I can typetrue/false
and it shows the stuff correctlyI know if I do my dataset as
select id, client_id, animal, final_value::text from example_table
I'll get all text values, but I wonder whats happening with the above example betweenFalse/True
andfalse/true
.Screenshots/recordings
No response
Superset version
4.0.2
Python version
3.10
Node version
I don't know
Browser
Chrome
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: