Skip to content

fix: sqlite decimal filter error with __gt#2020

Merged
waketzheng merged 6 commits into
tortoise:developfrom
waketzheng:fix-sqlite-decimal-filter
Nov 27, 2025
Merged

fix: sqlite decimal filter error with __gt#2020
waketzheng merged 6 commits into
tortoise:developfrom
waketzheng:fix-sqlite-decimal-filter

Conversation

@waketzheng

@waketzheng waketzheng commented Nov 23, 2025

Copy link
Copy Markdown
Contributor

Description

Fixes #2017

Motivation and Context

image

function_cast of DecimalField for sqlite does not used when querying. BUG fixed when this function was called as expected.

How Has This Been Tested?

make ci

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added the changelog accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codspeed-hq

codspeed-hq Bot commented Nov 23, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #2020 will not alter performance

Comparing waketzheng:fix-sqlite-decimal-filter (ed548f6) with develop (fe41c34)

Summary

✅ 16 untouched

@coveralls

coveralls commented Nov 24, 2025

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 19656027870

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 90.717%

Totals Coverage Status
Change from base Build 19655729262: 0.01%
Covered Lines: 6631
Relevant Lines: 7195

💛 - Coveralls

Comment thread tortoise/expressions.py Outdated
op = filter_info["operator"]
criterion = op(table[filter_info.get("source_field", filter_info["field"])], value)
term: Term = table[filter_info.get("source_field", filter_info["field"])]
if func := field_object and field_object.get_for_dialect(

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.

Can you please help me to understand why do we need to assign field_object to func?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK, updated. Code refactored for readability.

@waketzheng
waketzheng merged commit 752762c into tortoise:develop Nov 27, 2025
9 checks passed
@waketzheng
waketzheng deleted the fix-sqlite-decimal-filter branch November 28, 2025 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The result of querying the Decimal field through the filter interface does not meet expectations

3 participants