Skip to content

Commit 37351db

Browse files
committed
use flatten_atribute_list
1 parent 6268ebf commit 37351db

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

datajoint/expression.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,7 @@ def sorting_clauses(self):
126126
return ""
127127
clause = (
128128
""
129-
if not self.primary_key
130-
and all(
131-
re.match(r"^\s*KEY(\s+[aA][Ss][Cc])?\s*$", a)
132-
or re.match(r"^\s*KEY\s+[Dd][Ee][Ss][Cc]\s*$", a)
133-
for a in self._top.order_by
134-
)
129+
if not any(_flatten_attribute_list(self.primary_key, self._top.order_by))
135130
else f" ORDER BY \
136131
{', '.join(_flatten_attribute_list(self.primary_key, self._top.order_by))}"
137132
)

0 commit comments

Comments
 (0)