Skip to content

Incorrect filtering for numeric values with different decimal precision #33206

Open
@vddavydova

Description

@vddavydova

Bug description

Summary

There is an issue with filtering numeric values in Superset when values have different numbers of digits after the decimal point.

Steps to Reproduce

  1. Add a filter for a numeric field that contains both integer and decimal values (e.g., 21, 21.8, 25.35, etc.).

Image

  1. First select an integer value (for example, 21) in the filter, and then fractional values.

Image

  1. The query returns only the rows where the value is exactly 21 (i.e., without any decimal places), excluding 21.8, 25.35, etc.

Image

Image

  1. Now, if you select a decimal value first (e.g., 21.8 or 25.35), the filtering works as expected, returning all matching rows regardless of decimal precision.

Image

Image

Expected Behavior

Filtering by numeric value should match all equivalent numeric representations (e.g., 21, 21.8, 25.35) regardless of how many decimal places are used.

Actual Behavior

Filtering is inconsistent depending on whether an integer or decimal value is selected first. Selecting an integer leads to an overly strict match that excludes decimal representations of the same value.

Databases Affected

This issue has been observed across all three databases tested:

  • ClickHouse
  • Impala
  • PostgreSQL

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

I don't know

Browser

Not applicable

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • 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.

Metadata

Metadata

Assignees

Labels

good first issueGood first issues for new contributors

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions