-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor and improve discussion suggestions #288
Conversation
296f8d8
to
df12398
Compare
resolve_discussion_suggestions
33602be
to
05ae271
Compare
if isinstance(order_by, str): | ||
raise TypeError( | ||
"`order_by` should be an iterable of strings, and not a string." | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tä eksplisiittinen tyypin tsekkaus on siks, että str
on validi Iterable[str]
tyyppi, mutta tässä se kärähtäis tosi pahasti: .order_by("grouped_ordering", *order_by)
kun jos order_by
olis vaikka "foobar"
ni päädyttäis ajamaan query .order_by("grouped_ordering", "f", "o", "o", "b", "a", "r")
joka olis lievästi sanottuna mielenkiinosta, ja se error message siitä ei olis kovin selkeä.
Pelkillä tyyppihinteillä ei oo mahdollista määritellä tätä rajotusta: python/typing#256
05ae271
to
64b6b43
Compare
Codecov Report
@@ Coverage Diff @@
## develop #288 +/- ##
===========================================
+ Coverage 95.96% 96.15% +0.18%
===========================================
Files 78 78
Lines 2629 2627 -2
Branches 169 167 -2
===========================================
+ Hits 2523 2526 +3
+ Misses 68 66 -2
+ Partials 38 35 -3
Continue to review full report at Codecov.
|
5b9d593
to
95e2cf7
Compare
The queries get formatted just fine to be honest.
Main reason for this was to keep the most important content suggestions first. E.g. the user's own school should always be the first school that we're suggesting.
95e2cf7
to
da7ec8d
Compare
https://trello.com/c/CTkatfAG/880-show-own-school-first-in-discussion-suggestions
Main reason for this was to keep the most important content suggestions
first. E.g. the user's own school should always be the first school that
we're suggesting.
Changed