Skip to content

[explore] Filter Select not working for int and bool #2814

Closed
@rumbin

Description

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.18.2

Expected results

Integer and boolean column values get fetched for the Filter Select drop-downs in explore view.

Actual results

Selecting a column for filtering which is of type integer or boolean will not populate the select field with the column's distinct values.

2017-05-25 07:18:07,705:ERROR:root:1 is not JSON serializable
Traceback (most recent call last):
  File "/opt/apps/superset/venv_py3_test/lib64/python3.4/site-packages/superset/views/base.py", line 49, in wraps
    return f(self, *args, **kwargs)
  File "/opt/apps/superset/venv_py3_test/lib64/python3.4/site-packages/flask_appbuilder/security/decorators.py", line 52, in wraps
    return f(self, *args, **kwargs)
  File "/opt/apps/superset/venv_py3_test/lib64/python3.4/site-packages/superset/views/core.py", line 1090, in filter
    payload = json.dumps(datasource.values_for_column(column))
  File "/usr/lib64/python3.4/json/__init__.py", line 230, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib64/python3.4/json/encoder.py", line 192, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib64/python3.4/json/encoder.py", line 250, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib64/python3.4/json/encoder.py", line 173, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: 1 is not JSON serializable

Steps to reproduce

  • register the superset maintenance table main.ab_user in superset
  • Enable Filter Select for it and make some columns of type int or bool filterable
  • explore the table and select one of the above columns for filtering

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions