Skip to content

Commit

Permalink
fix(sqlglot): manually cast to avoid incorrect optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Aug 23, 2024
1 parent 8046d3f commit 83630aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ibis/backends/sql/compilers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,9 @@ def if_(self, condition, true, false: sge.Expression | None = None) -> sge.If:
)

def cast(self, arg, to: dt.DataType) -> sge.Cast:
return sg.cast(sge.convert(arg), to=self.type_mapper.from_ibis(to), copy=False)
return sge.Cast(
this=sge.convert(arg), to=self.type_mapper.from_ibis(to), copy=False
)

def _prepare_params(self, params):
result = {}
Expand Down

0 comments on commit 83630aa

Please sign in to comment.