kraftaa opened a new issue, #30391:
URL: https://github.com/apache/superset/issues/30391

   ### Bug description
   
   I'm running Superset in kubernetes via helm chart.
   
   I have a postgres table with such a definition 
   ```
   CREATE TABLE example_table (
       id BIGINT primary key,
       client_id bigint,
       full_key TEXT,
       final_value JSONB,
       random_bool boolean
   );
   ```
   
   I've added values there 
   ```
   id | client_id | full_key | final_value | random_bool 
   ----+-----------+----------+-------------+-------------
     1 |         1 | animal   | false       | t
     2 |         1 | bird     | false       | t
     3 |         1 | fish     | true        | t
     4 |         1 | sunny    | false       | t
     5 |         1 | name     | "jane"      | t
     6 |         2 | animal   | true        | f
     7 |         2 | bird     | false       | t
     9 |         2 | fish     | true        | t
    10 |         2 | sunny    | true        | f
    11 |         2 | name     | "tom"       | f
   ....
   ```
   Then I'm looking in `sql lab` and see that `final_value` is converted to 
Python boolean
   <img width="555" alt="image" 
src="https://github.com/user-attachments/assets/2a6af575-235d-412f-a3f8-967855f053b4";>
   
   I'm looking at the dashboard and seeing `False/True` in `final_value` column
   <img width="842" alt="image" 
src="https://github.com/user-attachments/assets/effe3c37-922d-4a84-bc18-61a96e0f2956";>
   
   If I select another filter it'll show `false/true` not `False/True` in 
`final_value` column
   <img width="816" alt="image" 
src="https://github.com/user-attachments/assets/7aec013b-debf-46f5-a5ea-ad88cfa5adc2";>
   
   
   For 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 )
   ```
   select * from example_table
   where 1=1
   
   {% for filter in get_filters('final_value', remove_filter=True) %}
     {% if filter.get('op') == 'IN' %}
       {% set filter_value = filter.get('val')[0] %}
       {% if filter_value is boolean %}
         AND final_value::text = '{{ 'true' if filter_value else 'false' }}'
       {% else %}
         AND final_value::text LIKE '%' || '{{ filter_value }}' || '%'
       {% endif %}
     {% else %}
       {% set filter_value = filter.get('val')[0] %}
       {% if filter_value is boolean %}
         AND final_value::text = '{{ 'true' if filter_value else 'false' }}'
       {% else %}
         AND final_value::text LIKE '%' || '{{ filter_value }}' || '%'
       {% endif %}
     {% endif %}
   {% endfor %}
   ```
   
   
   
   
   
   ### How to reproduce the bug
   
   go to the dataset, choose `False` in and see No data returned, because there 
is not `False/True` in this column
   <img width="755" alt="image" 
src="https://github.com/user-attachments/assets/6c98ae1c-f7a7-43ed-b6a8-81c7eac0be65";>
   
   If I type for `like` I can type `true/false` and it shows the stuff correctly
   <img width="778" alt="image" 
src="https://github.com/user-attachments/assets/3ed9b827-2782-4b7c-8d04-4a4e1f2d59ec";>
   
   I 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 between `False/True` and `false/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
   
   - [X] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [X] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [X] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to