Skip to content

fix(rison-filters): only catch ParserException when parsing filters - #43076

Open
aadhyap wants to merge 2 commits into
apache:masterfrom
aadhyap:fix/rison-filter-exception
Open

fix(rison-filters): only catch ParserException when parsing filters#43076
aadhyap wants to merge 2 commits into
apache:masterfrom
aadhyap:fix/rison-filter-exception

Conversation

@aadhyap

@aadhyap aadhyap commented Aug 11, 2026

Copy link
Copy Markdown

Summary

RisonFilterParser.parse() currently catches Exception around both
prison.loads() and _convert_to_adhoc_filters().

Malformed Rison raises prison.decoder.ParserException, so the exception
handling can be narrowed to the parsing step. This preserves the current
behavior for invalid Rison while allowing unexpected conversion errors to
surface instead of being logged as parsing failures.

Changes

  • Catch prison.decoder.ParserException around prison.loads()
  • Move _convert_to_adhoc_filters() outside the parsing try
  • Add tests for malformed Rison and unexpected conversion errors

Testing

  • pytest tests/unit_tests/utils/test_rison_filters.py
  • 17 tests passed

…lters

Co-Authored-By: bot_apk <apk@cognition.ai>
@bito-code-review

bito-code-review Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #1ff967

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: e3b8e49..e3b8e49
    • superset/utils/rison_filters.py
    • tests/unit_tests/utils/test_rison_filters.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas
rusackas requested review from hughhhh and a lite review from Copilot August 11, 2026 20:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens error handling in RisonFilterParser.parse() so only malformed Rison parsing failures are caught and logged, while unexpected errors in filter conversion logic correctly surface. This improves observability by avoiding misclassification of conversion bugs as parsing failures.

Changes:

  • Narrow exception handling to prison.decoder.ParserException for prison.loads() failures.
  • Move _convert_to_adhoc_filters() outside the parsing try so conversion errors propagate.
  • Add unit tests covering malformed Rison warning logs and conversion-error propagation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
superset/utils/rison_filters.py Restricts exception handling to parsing errors and lets conversion exceptions bubble up.
tests/unit_tests/utils/test_rison_filters.py Adds coverage for warning logging on invalid Rison and for surfacing conversion errors.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.64%. Comparing base (762fdcc) to head (a5afdbd).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
superset/utils/rison_filters.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #43076      +/-   ##
==========================================
- Coverage   66.64%   66.64%   -0.01%     
==========================================
  Files        2866     2866              
  Lines      162896   162897       +1     
  Branches    37525    37525              
==========================================
- Hits       108568   108565       -3     
- Misses      52203    52206       +3     
- Partials     2125     2126       +1     
Flag Coverage Δ
hive 38.17% <0.00%> (-0.01%) ⬇️
mysql 57.90% <0.00%> (-0.01%) ⬇️
postgres 57.94% <0.00%> (-0.01%) ⬇️
presto 40.12% <0.00%> (-0.01%) ⬇️
python 59.33% <0.00%> (-0.01%) ⬇️
sqlite 57.57% <0.00%> (-0.01%) ⬇️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants