From 1776597131ef96472b5188cebc72c31a387c90f4 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 22 Jun 2017 23:51:52 -0400 Subject: Coerce float Python type to Float; ensure Python float coming back Added some extra strictness to the handling of Python "float" values passed to SQL statements. A "float" value will be associated with the :class:`.Float` datatype and not the Decimal-coercing :class:`.Numeric` datatype as was the case before, eliminating a confusing warning emitted on SQLite as well as unecessary coercion to Decimal. Change-Id: I1bb1810ff1d198c0d929ccba5656e55401d74119 Fixes: #4017 --- lib/sqlalchemy/sql/sqltypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py index 7a3c50549..06b5e5c19 100644 --- a/lib/sqlalchemy/sql/sqltypes.py +++ b/lib/sqlalchemy/sql/sqltypes.py @@ -2604,7 +2604,7 @@ MATCHTYPE = MatchType() _type_map = { int: Integer(), - float: Numeric(), + float: Float(), bool: BOOLEANTYPE, decimal.Decimal: Numeric(), dt.date: Date(), -- cgit v1.2.1