Skip to content

Commit

Permalink
Sort by RoundType in success streak.
Browse files Browse the repository at this point in the history
Currently the longest_success_streak query does not sort rounds, which leads to nondeterminism when a streak begins / ends during a multi-round competition.

In addition, stop joining with Events because this table is not used in the query.

Fixes thewca#89.
  • Loading branch information
timreyn committed Sep 18, 2022
1 parent b659289 commit 14e07f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions misc/python/statistics/longest_success_streak.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ def __init__(self, wca_id, name, country):
Results r
inner join Competitions c on
r.competitionId = c.id
inner join Events e on
r.eventId = e.id
inner join RoundTypes rt on
r.roundTypeId = rt.id
where
eventId = %(event_id)s
order by
start_date,
e.`rank`"""
rt.`rank`"""


def longest_streaks():
Expand Down

0 comments on commit 14e07f9

Please sign in to comment.