Surround exclude expression with parenthesis

Closes #13576
(grafted from e3ad47f562e5a8b03d4ff01014c83944c9dbd9ce)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier
2024-10-09 17:19:44 +02:00
parent cac5ebd099
commit 47d012aadd
+7 -1
View File
@@ -137,7 +137,13 @@ class Exclude(Constraint):
return self._where
def __str__(self):
exclude = ', '.join('%s WITH %s' % (column, operator._operator)
def format_(element):
if isinstance(element, Column):
return element
else:
return '(%s)' % element
exclude = ', '.join(
'%s WITH %s' % (format_(column), operator._operator)
for column, operator in self.excludes)
where = ''
if self.where: