]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
change float -> Double in the _type_map.
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 20 Jan 2026 14:45:25 +0000 (09:45 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 21 Jan 2026 01:31:41 +0000 (20:31 -0500)
commit1dc49abfea36f6f517b40b15514f10fe439b2926
tree91cd9b8419d35815d3df62efef7844aeaffc4d20
parentda9f9e19c61e813aa97421afbbfbfa63259666c9
change float -> Double in the _type_map.

The :class:`.Double` type is now used when a Python float value is detected
as a literal value to be sent as a bound parameter, rather than the
:class:`.Float` type.  :class:`.Double` has the same implementation as
:class:`.Float`, but when rendered in a CAST, produces ``DOUBLE`` or
``DOUBLE PRECISION`` rather than ``FLOAT``.   The former better matches
Python's ``float`` datatype which uses 8-byte double-precision storage.
Third party dialects which don't support the :class:`.Double` type directly
may need adjustment so that they render an appropriate keyword (e.g.
``FLOAT``) when the :class:`.Double` datatype is encountered.

Fixes: #10300
Change-Id: I6d221ca9206a10c73fefad55f7ab7a6da5c81d6b
doc/build/changelog/migration_21.rst
doc/build/changelog/unreleased_21/10300.rst [new file with mode: 0644]
lib/sqlalchemy/sql/sqltypes.py
test/ext/test_hybrid.py
test/sql/test_types.py