Skip to content

Commit

Permalink
Remove type: ignore.
Browse files Browse the repository at this point in the history
  • Loading branch information
evetion committed Jan 19, 2024
1 parent bdd638e commit fc17d7d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/ribasim/ribasim/input_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Any,
Generic,
TypeVar,
cast,
)

import geopandas as gpd
Expand Down Expand Up @@ -409,7 +410,9 @@ def set_sort_keys(cls, v: Any, info: ValidationInfo) -> Any:
field = cls.model_fields[getattr(info, "field_name")]
extra = field.json_schema_extra
if extra is not None and isinstance(extra, dict):
v._sort_keys = extra.get("sort_keys", []) # type: ignore
# We set sort_keys ourselves as list[str] in json_schema_extra
# but mypy doesn't know.
v._sort_keys = cast(list[str], extra.get("sort_keys", []))
return v

@classmethod
Expand Down

0 comments on commit fc17d7d

Please sign in to comment.