Skip to content

Commit

Permalink
fix case render
Browse files Browse the repository at this point in the history
  • Loading branch information
ea-rus committed Nov 10, 2024
1 parent 65b3d05 commit 4298b66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mindsdb_sql/render/sqlalchemy_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,11 @@ def prepare_case(self, t: ast.Case):
if t.default is not None:
default = self.to_expression(t.default)

return sa.case(*conditions, else_=default)
value = None
if t.arg is not None:
value = self.to_expression(t.arg)

return sa.case(*conditions, else_=default, value=value)

def to_function(self, t):
op = getattr(sa.func, t.op)
Expand Down

0 comments on commit 4298b66

Please sign in to comment.