Skip to content

Commit aa58b86

Browse files
Fix for issue Casting to sa.Float (and some other types) silently does (#154)
nothing #151 Signed-off-by: Balram Choudhary <bchoudhary@rocketsoftware.com>
1 parent bfe67ae commit aa58b86

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ibm_db_sa/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,9 @@ def visit_cast(self, cast, **kw):
454454
# other types, I was able to CAST against VARCHAR
455455
# for example
456456
if isinstance(type_, (
457-
sa_types.DateTime, sa_types.Date, sa_types.Time,
458-
sa_types.DECIMAL, sa_types.String)):
457+
sa_types.DateTime, sa_types.Date, sa_types.Time, sa_types.DOUBLE, sa_types.Double, sa_types.Integer, sa_types.INTEGER,
458+
sa_types.Boolean, sa_types.BOOLEAN, sa_types.BIGINT, sa_types.BigInteger, sa_types.BINARY, sa_types.NUMERIC, sa_types.SmallInteger,
459+
sa_types.DECIMAL, sa_types.String, sa_types.Float, sa_types.FLOAT, sa_types.Numeric)):
459460
return super(DB2Compiler, self).visit_cast(cast, **kw)
460461
else:
461462
return self.process(cast.clause)

0 commit comments

Comments
 (0)