Skip to content

Table Viz errors with filters containing number column "IS NOT NULL" or "IS NULL" #13229

@michellethomas

Description

@michellethomas

On the table viz if someone adds a filter with a numeric column and the filter type "IS NOT NULL" or "IS NULL". The chart errors on this line with:

File "superset/connectors/sqla/models.py", line 1080, in get_sqla_query
    eq = utils.cast_to_num(flt["val"])
KeyError: 'val'

I looked at this line and I don't see anything that has changed recently so I'm assuming that this is related to some change with the table viz. But I'm not sure how it should be handled, the filter has no "val" because it is just an "IS NULL" filter.

Expected results

Chart should load

Actual results

Chart errors

How to reproduce the bug

  1. Create a table chart
  2. Add a filter on a numeric column with column "IS NOT NULL"
  3. Run query and see error

Environment

(please complete the following information):

  • superset version: master

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are 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.

@ktmud do you have any ideas about whether a recent table change might have caused this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    #bug:regressionBugs that are identified as regessionsviz:charts:tableRelated to the Table chart

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions