From: Dimitris Theodorou Date: Mon, 12 Jan 2015 03:16:14 +0000 (+0100) Subject: remove redundant Float type check X-Git-Tag: rel_0_7_4~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9c10cb7a21dd87c51c9abd886331175d0c10418;p=thirdparty%2Fsqlalchemy%2Falembic.git remove redundant Float type check --- diff --git a/alembic/ddl/postgresql.py b/alembic/ddl/postgresql.py index 4c6e9d79..ac3a5f48 100644 --- a/alembic/ddl/postgresql.py +++ b/alembic/ddl/postgresql.py @@ -4,7 +4,7 @@ from .. import compat from .base import compiles, alter_table, format_table_name, RenameTable from .impl import DefaultImpl from sqlalchemy.dialects.postgresql import INTEGER, BIGINT -from sqlalchemy import text, Float, Numeric +from sqlalchemy import text, Numeric import logging log = logging.getLogger(__name__) @@ -36,7 +36,7 @@ class PostgresqlImpl(DefaultImpl): isinstance(metadata_column.server_default.arg, compat.string_types) and \ not re.match(r"^'.+'$", rendered_metadata_default) and \ - not isinstance(inspector_column.type, (Float, Numeric)): + not isinstance(inspector_column.type, Numeric): # don't single quote if the column type is float/numeric, # otherwise a comparison such as SELECT 5 = '5.0' will fail rendered_metadata_default = "'%s'" % rendered_metadata_default