Skip to content

Commit

Permalink
Presumably fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
thesadru committed Sep 19, 2024
1 parent cac20dd commit 54dd961
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion genshin-dev/pytest-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pytest
pytest-asyncio
pytest-asyncio~=0.21.2
pytest-cov
pytest-dotenv

Expand Down
2 changes: 2 additions & 0 deletions genshin/models/genshin/character.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def _get_db_char(
) -> constants.DBChar:
"""Get the appropriate DBChar object from specific fields."""
if lang not in constants.CHARACTER_NAMES:
if id and name and icon and element and rarity:
return constants.DBChar(id or 0, _parse_icon(icon), name, element, rarity, guessed=True)
raise Exception(
f"Character names not loaded for {lang!r}. Please run `await genshin.utility.update_characters_any()`."
)
Expand Down
7 changes: 4 additions & 3 deletions genshin/models/genshin/chronicle/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from genshin.models import hoyolab
from genshin.models.model import Aliased, APIModel

from . import abyss, activities, characters
from . import abyss, activities
from . import characters as characters_module

__all__ = [
"AreaExploration",
Expand Down Expand Up @@ -159,7 +160,7 @@ class PartialGenshinUserStats(APIModel):

info: hoyolab.UserInfo = Aliased("role")
stats: Stats
characters: typing.Sequence["characters.PartialCharacter"] = Aliased("avatars")
characters: typing.Sequence[characters_module.PartialCharacter] = Aliased("avatars")
explorations: typing.Sequence[Exploration] = Aliased("world_explorations")
teapot: typing.Optional[Teapot] = Aliased("homes")

Expand All @@ -175,7 +176,7 @@ def __format_teapot(cls, v: typing.Any) -> typing.Optional[typing.Dict[str, typi
class GenshinUserStats(PartialGenshinUserStats):
"""User stats with characters with equipment"""

characters: typing.Sequence["characters.Character"] = Aliased("avatars")
characters: typing.Sequence[characters_module.Character] = Aliased("avatars")


class FullGenshinUserStats(GenshinUserStats):
Expand Down
2 changes: 1 addition & 1 deletion genshin/models/honkai/chronicle/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __normalize_rank(cls, rank: typing.Optional[str]) -> typing.Optional[int]:

return 69 - ord(rank)

model_config = pydantic.ConfigDict(frozen=False)
model_config: pydantic.ConfigDict = pydantic.ConfigDict(frozen=False) # type: ignore


# flake8: noqa: E222
Expand Down
2 changes: 1 addition & 1 deletion genshin/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class APIModel(pydantic.BaseModel):
"""Modified pydantic model."""

model_config = pydantic.ConfigDict(arbitrary_types_allowed=True)
model_config: pydantic.ConfigDict = pydantic.ConfigDict(arbitrary_types_allowed=True) # type: ignore


class Unique(abc.ABC):
Expand Down

0 comments on commit 54dd961

Please sign in to comment.