fix(rison-filters): only catch ParserException when parsing filters - #43076
fix(rison-filters): only catch ParserException when parsing filters#43076aadhyap wants to merge 2 commits into
Conversation
…lters Co-Authored-By: bot_apk <apk@cognition.ai>
Code Review Agent Run #1ff967Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
There was a problem hiding this comment.
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.ParserExceptionforprison.loads()failures. - Move
_convert_to_adhoc_filters()outside the parsingtryso 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 Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
RisonFilterParser.parse()currently catchesExceptionaround bothprison.loads()and_convert_to_adhoc_filters().Malformed Rison raises
prison.decoder.ParserException, so the exceptionhandling 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
prison.decoder.ParserExceptionaroundprison.loads()_convert_to_adhoc_filters()outside the parsingtryTesting
pytest tests/unit_tests/utils/test_rison_filters.py