Skip to content

Commit

Permalink
Fix types of MangaStatistics.distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
AbstractUmbra committed Feb 23, 2022
1 parent fd4e419 commit 2b34ad1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions hondana/manga.py
Original file line number Diff line number Diff line change
Expand Up @@ -1474,8 +1474,9 @@ class MangaStatistics:
The manga these statistics belong to.
average: :class:`float`
The average mean score of the manga.
distribution: Optional[List[:class:`int`]]
distribution: Optional[Dict[:class:`str`, :class:`int`]]
The scoring distribution of the manga.
Keys are 1-10 and values are total amount of ratings per key.
.. note::
Expand All @@ -1501,7 +1502,7 @@ def __init__(
self.follows: int = payload["follows"]
self.parent_id: str = parent_id
self.average: float = self._rating["average"]
self.distribution: Optional[list[int]] = self._rating.get("distribution")
self.distribution: Optional[dict[str, int]] = self._rating.get("distribution")

def __repr__(self) -> str:
return f"<MangaStatistics for='{self.parent_id}'>"
Expand Down
4 changes: 2 additions & 2 deletions hondana/types/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ class StatisticsRatingResponse(TypedDict):
"""
average: :class:`float`
distribution: List[:class:`int`]
distribution: Dict[:class:`str`, :class:`int`]
"""

average: float
distribution: list[int]
distribution: dict[str, int]


class BatchStatisticsRatingResponse(TypedDict):
Expand Down

0 comments on commit 2b34ad1

Please sign in to comment.