Skip to content

fix: Fixed numeric filtering issue in Superset #33222

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sayan199
Copy link

@Sayan199 Sayan199 commented Apr 23, 2025

SUMMARY

Fixes #33206

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

In order to test this, we need to

  1. Add a filter for a numeric field that contains both integer and decimal values (e.g., 21, 21.8, 25.35, etc.).
  2. First select an integer value (for example, 21) in the filter, and then fractional values.
    This should now be able to filter and give results that do match with 21 but also with 21.8 and 25.35

ADDITIONAL INFORMATION

  • Has associated issue: Incorrect filtering for numeric values with different decimal precision #33206
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@Sayan199 Sayan199 closed this Apr 23, 2025
@Sayan199 Sayan199 reopened this Apr 23, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Documentation Missing temporal range value handling explanation ▹ view 🧠 Not in standard
Files scanned
File Path Reviewed
superset/models/helpers.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines 1162 to 1164
def handle_single_value(value: Optional[FilterValue]) -> Optional[FilterValue]:
if operator == utils.FilterOperator.TEMPORAL_RANGE:
return value

This comment was marked as resolved.

@rusackas rusackas changed the title Fixed numeric filtering issue in Superset fix: Fixed numeric filtering issue in Superset Apr 23, 2025
@rusackas
Copy link
Member

Looks like there are a bunch of CI tasks failing, but we should probably start by running pre-commit to fix the linting/formatting issues, and see if anything else gets unblocked.

Superset uses Git pre-commit hooks courtesy of pre-commit. To install run the following:

pip3 install -r requirements/development.txt
pre-commit install
A series of checks will now run when you make a git commit.

Alternatively it is possible to run pre-commit by running pre-commit manually:

pre-commit run --all-files

@michael-s-molina
Copy link
Member

Possible duplicate of #33230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect filtering for numeric values with different decimal precision
3 participants