mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-29 20:34:31 +02:00
Make least_common/most_common order dependable for tests
This commit is contained in:
parent
5a813bae6d
commit
95a966bb62
2 changed files with 6 additions and 6 deletions
|
|
@ -1979,8 +1979,8 @@ class Table(Queryable):
|
|||
most_common = [
|
||||
(truncate(r[0]), r[1])
|
||||
for r in db.execute(
|
||||
"select [{}], count(*) from [{}] group by [{}] order by count(*) desc limit {}".format(
|
||||
column, table, column, common_limit
|
||||
"select [{}], count(*) from [{}] group by [{}] order by count(*) desc, [{}] limit {}".format(
|
||||
column, table, column, column, common_limit
|
||||
)
|
||||
).fetchall()
|
||||
]
|
||||
|
|
@ -1992,8 +1992,8 @@ class Table(Queryable):
|
|||
least_common = [
|
||||
(truncate(r[0]), r[1])
|
||||
for r in db.execute(
|
||||
"select [{}], count(*) from [{}] group by [{}] order by count(*) limit {}".format(
|
||||
column, table, column, common_limit
|
||||
"select [{}], count(*) from [{}] group by [{}] order by count(*), [{}] desc limit {}".format(
|
||||
column, table, column, column, common_limit
|
||||
)
|
||||
).fetchall()
|
||||
]
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ def db_to_analyze(fresh_db):
|
|||
num_null=0,
|
||||
num_blank=0,
|
||||
num_distinct=4,
|
||||
most_common=[("Joan", 3), ("Terry...", 2)],
|
||||
least_common=[("Anne", 1), ("Kumar", 2)],
|
||||
most_common=[("Joan", 3), ("Kumar", 2)],
|
||||
least_common=[("Anne", 1), ("Terry...", 2)],
|
||||
),
|
||||
),
|
||||
(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue