Skip to content

Commit 0962b70

Browse files
authored
Merge pull request #3 from A-Baji/fix-#926
unified string formatting
2 parents cc4f378 + 8a6edf6 commit 0962b70

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

datajoint/expression.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,10 +634,11 @@ def make_sql(self):
634634
if not arg1.heading.secondary_attributes and not arg2.heading.secondary_attributes:
635635
# no secondary attributes: use UNION DISTINCT
636636
fields = arg1.primary_key
637-
return ("SELECT * FROM (({sql1}) UNION ({sql2})) as `_u%x`".format(
637+
return ("SELECT * FROM (({sql1}) UNION ({sql2})) as `_u{alias}`".format(
638638
sql1=arg1.make_sql() if isinstance(arg1, Union) else arg1.make_sql(fields),
639639
sql2=arg2.make_sql() if isinstance(arg2, Union) else arg2.make_sql(fields),
640-
)) % next(self.__count)
640+
alias=next(self.__count)
641+
))
641642
# with secondary attributes, use union of left join with antijoin
642643
fields = self.heading.names
643644
sql1 = arg1.join(arg2, left=True).make_sql(fields)

0 commit comments

Comments
 (0)