fix: preserve decimals in mixed numeric IN filters - #42625
fix: preserve decimals in mixed numeric IN filters#42625codewithdaniel1 wants to merge 2 commits into
Conversation
Code Review Agent Run #d8a6f7Actionable 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #42625 +/- ##
==========================================
- Coverage 65.44% 65.44% -0.01%
==========================================
Files 2810 2810
Lines 159362 159365 +3
Branches 36372 36373 +1
==========================================
- Hits 104294 104291 -3
- Misses 53026 53030 +4
- Partials 2042 2044 +2
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:
|
Code Review Agent Run #3ea6a8Actionable 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 |
SUMMARY
Fixes #33206.
This fixes numeric
INfilters where selecting an integer value before decimal values could cause later decimal values to be coerced to integers when SQLAlchemy compiles the query.For example, a mixed numeric filter like:
could compile as:
because SQLAlchemy infers the expanding
INparameter type from the first value.This change preserves the original numeric values and only reorders mixed integer/decimal
INlists so that a decimal value appears first. SQLINlist ordering does not affect filter semantics, but it prevents decimal values from being coerced to integers.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable. This is a backend SQL generation fix covered by a unit regression test.
TESTING INSTRUCTIONS
Ran the targeted regression test:
python -m pytest tests/unit_tests/models/helpers_test.py \ -k "numeric_in_filter_preserves_decimals_when_integer_is_first" -qResult:
Ran the full helper test file:
Result:
Ran pre-commit on the changed files:
Result:
ADDITIONAL INFORMATION