Skip to content

Commit

Permalink
Fix for issue Casting to sa.Float (and some other types) silently does
Browse files Browse the repository at this point in the history
nothing #151

Signed-off-by: Balram Choudhary <[email protected]>
  • Loading branch information
bchoudhary6415 committed Dec 23, 2024
1 parent bfe67ae commit 6a9d2c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ibm_db_sa/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,9 @@ def visit_cast(self, cast, **kw):
# other types, I was able to CAST against VARCHAR
# for example
if isinstance(type_, (
sa_types.DateTime, sa_types.Date, sa_types.Time,
sa_types.DECIMAL, sa_types.String)):
sa_types.DateTime, sa_types.Date, sa_types.Time, sa_types.DOUBLE, sa_types.Double, sa_types.Integer, sa_types.INTEGER,
sa_types.Boolean, sa_types.BOOLEAN, sa_types.BIGINT, sa_types.BigInteger, sa_types.BINARY, sa_types.NUMERIC, sa_types.SmallInteger,
sa_types.DECIMAL, sa_types.String, sa_types.Float, sa_types.FLOAT, sa_types.Numeric)):
return super(DB2Compiler, self).visit_cast(cast, **kw)
else:
return self.process(cast.clause)
Expand Down

0 comments on commit 6a9d2c7

Please sign in to comment.