Skip to content

Commit

Permalink
fix render test
Browse files Browse the repository at this point in the history
  • Loading branch information
ea-rus committed Sep 20, 2024
1 parent 39a8d45 commit 53a402f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mindsdb_sql/render/sqlalchemy_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,10 @@ def prepare_case(self, t: ast.Case):
conditions.append(
(self.to_expression(condition), self.to_expression(result))
)
else_ = None
if t.default is not None:
else_ = self.to_expression(t.default)
conditions.append(self.to_expression(t.default))

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

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

0 comments on commit 53a402f

Please sign in to comment.