Skip to content

Commit 8a6edf6

Browse files
committed
unified string formatting
1 parent 8718b2b commit 8a6edf6

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)