]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Use _effective_decimal_return_scale in Numeric.result_processor
authorKadir Can Ozden <101993364+bysiber@users.noreply.github.com>
Thu, 9 Jul 2026 15:43:58 +0000 (11:43 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 9 Jul 2026 17:24:37 +0000 (13:24 -0400)
commit117851648a21cf6cb12430df33913f200a090100
treed51c3039964362711d6aa3bb08f9b1c9e08e9504
parent0c6e2f39df1e6748a916fc5f5a1a3b3296aed4af
Use _effective_decimal_return_scale in Numeric.result_processor

Fixed an issue in :class:`.Numeric` where the
:paramref:`.Numeric.decimal_return_scale` parameter was ignored when the
DBAPI does not support native decimal objects (i.e.
``dialect.supports_native_decimal`` is ``False``).  In this path the result
processor was computing the conversion scale from
:paramref:`.Numeric.scale` directly, bypassing
:paramref:`.Numeric.decimal_return_scale` entirely.  The behavior now
matches :class:`.Float`, which already used the correct
``_effective_decimal_return_scale`` property. Pull request courtesy Kadir
Can Ozden.

Fixes: #13424
Closes: #13137
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/13137
Pull-request-sha: 9d5dbc80a4d053b46454c87d56d36b51c672a2dc

Change-Id: Ib671aa9db19c64fe69d95a47a4b8420b96e918b9
doc/build/changelog/unreleased_20/13424.rst [new file with mode: 0644]
lib/sqlalchemy/sql/sqltypes.py
test/sql/test_types.py