diff --git a/ibis/backends/sql/compilers/mssql.py b/ibis/backends/sql/compilers/mssql.py index 31cba1126d38..cadc8b30cc1b 100644 --- a/ibis/backends/sql/compilers/mssql.py +++ b/ibis/backends/sql/compilers/mssql.py @@ -525,18 +525,20 @@ def visit_EndsWith(self, op, *, arg, end): return arg.like(self.f.concat("%", end)) def visit_LPad(self, op, *, arg, length, pad): - return sge.Case( - ifs=[self.if_(length <= self.f.length(arg), arg)], - default=self.f.left( + return self.if_( + length <= self.f.length(arg), + arg, + self.f.left( self.f.concat(self.f.replicate(pad, length - self.f.length(arg)), arg), length, ), ) def visit_RPad(self, op, *, arg, length, pad): - return sge.Case( - ifs=[self.if_(length <= self.f.length(arg), arg)], - default=self.f.left( + return self.if_( + length <= self.f.length(arg), + arg, + self.f.left( self.f.concat(arg, self.f.replicate(pad, length - self.f.length(arg))), length, ),