Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 1522854

Browse files
committed
Fix: Only concat when len(exprs)>1
1 parent e53d08d commit 1522854

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

data_diff/sql.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ class Checksum(Sql):
114114
exprs: Sequence[SqlOrStr]
115115

116116
def compile(self, c: Compiler):
117-
compiled_exprs = ", ".join(map(c.compile, self.exprs))
118-
expr = f"concat({compiled_exprs})"
117+
if len(self.exprs) > 1:
118+
compiled_exprs = ", ".join(map(c.compile, self.exprs))
119+
expr = f"concat({compiled_exprs})"
120+
else:
121+
expr ,= self.exprs
122+
expr = c.compile(expr)
119123
md5 = c.database.md5_to_int(expr)
120124
return f"sum({md5})"
121125

0 commit comments

Comments
 (0)