]> 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:49 +0000 (13:24 -0400)
commit53df8f959b52f304e7d5dc969a834c7386ee5393
tree20c048bb0a1bbd062d38fa75513563ae7099324f
parentfb213ed536336a71759259a1ee15f021b1c7903c
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
(cherry picked from commit 117851648a21cf6cb12430df33913f200a090100)
doc/build/changelog/unreleased_20/13424.rst [new file with mode: 0644]
lib/sqlalchemy/sql/sqltypes.py
test/sql/test_types.py