Skip to content

Commit

Permalink
refactor(typing): reduce type ignores in api.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dangotbanned committed Jul 15, 2024
1 parent bed0965 commit 6adf564
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 138 deletions.
11 changes: 4 additions & 7 deletions altair/utils/schemapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,10 +1071,7 @@ def _default_wrapper_classes(cls) -> Iterator[type[SchemaBase]]:

@classmethod
def from_dict(
cls: type[TSchemaBase],
dct: dict[str, Any],
validate: bool = True,
_wrapper_classes: Iterable[type[SchemaBase]] | None = None,
cls: type[TSchemaBase], dct: dict[str, Any], validate: bool = True, **kwds: Any
) -> TSchemaBase:
"""Construct class from a dictionary representation
Expand All @@ -1101,9 +1098,9 @@ def from_dict(
"""
if validate:
cls.validate(dct)
if _wrapper_classes is None:
_wrapper_classes = cls._default_wrapper_classes()
converter = _FromDict(_wrapper_classes)
converter = _FromDict(
kwds.pop("_wrapper_classes", cls._default_wrapper_classes())
)
return converter.from_dict(dct, cls)

@classmethod
Expand Down
Loading

0 comments on commit 6adf564

Please sign in to comment.