From ff821e57c960f095ab2988a0f892b3127374f498 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Wed, 26 Apr 2023 21:40:38 +0200 Subject: Ensure float are not implemented as numeric Fixed the base class for dialect-specific float/double types; Oracle :class:`_oracle.BINARY_DOUBLE` now subclasses :class:`_sqltypes.Double`, and internal types for :class:`_sqltypes.Float` for asyncpg and pg8000 now correctly subclass :class:`_sqltypes.Float`. Added suite tests to ensure that floating point types, such as class:`_types.Float` and :class:`_types.Double` are not resolved as class:`_types.Numeric` in the dialect, since it may not compatible in all cases, such as when casting a value. Change-Id: I20b814e8e029d57921d9728a55f2570f74c35c87 --- lib/sqlalchemy/dialects/postgresql/asyncpg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/dialects/postgresql/asyncpg.py') diff --git a/lib/sqlalchemy/dialects/postgresql/asyncpg.py b/lib/sqlalchemy/dialects/postgresql/asyncpg.py index c879205e4..a25502b90 100644 --- a/lib/sqlalchemy/dialects/postgresql/asyncpg.py +++ b/lib/sqlalchemy/dialects/postgresql/asyncpg.py @@ -322,7 +322,7 @@ class AsyncpgNumeric(sqltypes.Numeric): ) -class AsyncpgFloat(AsyncpgNumeric): +class AsyncpgFloat(AsyncpgNumeric, sqltypes.Float): __visit_name__ = "float" render_bind_cast = True -- cgit v1.2.1