Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(typing): reduce type ignores in api.py #3480

Merged
merged 13 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions altair/utils/schemapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,10 +1087,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
dangotbanned marked this conversation as resolved.
Show resolved Hide resolved
) -> TSchemaBase:
"""Construct class from a dictionary representation

Expand All @@ -1117,9 +1114,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