Ensure reliable sort order for tests

This commit is contained in:
Simon Willison 2020-12-12 21:43:52 -08:00
commit 5a813bae6d

View file

@ -1984,6 +1984,7 @@ class Table(Queryable):
)
).fetchall()
]
most_common.sort(key=lambda p: (p[1], p[0]), reverse=True)
if num_distinct <= common_limit:
# No need to run the query if it will just return the results in revers order
least_common = None
@ -1996,6 +1997,7 @@ class Table(Queryable):
)
).fetchall()
]
least_common.sort(key=lambda p: (p[1], p[0]))
return ColumnDetails(
self.name,
column,