Skip to content

Commit

Permalink
Add SchemaBase as return type to from_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
binste committed Aug 10, 2023
1 parent f83caa5 commit 2732c8f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion altair/utils/schemapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ def from_dict(
_wrapper_classes: Optional[Iterable[Type["SchemaBase"]]] = None,
# Type hints for this method would get rather complicated
# if we want to provide a more specific return type
) -> Any:
) -> "SchemaBase":
"""Construct class from a dictionary representation
Parameters
Expand Down
2 changes: 1 addition & 1 deletion altair/vegalite/v5/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2592,7 +2592,7 @@ def _get_name(cls):
return f"view_{cls._counter}"

@classmethod
def from_dict(cls, dct, validate=True) -> "Chart": # type: ignore[override] # Not the same signature as SchemaBase.from_dict. Would ideally be aligned in the future
def from_dict(cls, dct, validate=True) -> core.SchemaBase: # type: ignore[override] # Not the same signature as SchemaBase.from_dict. Would ideally be aligned in the future
"""Construct class from a dictionary representation
Parameters
Expand Down
2 changes: 1 addition & 1 deletion tools/schemapi/schemapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ def from_dict(
_wrapper_classes: Optional[Iterable[Type["SchemaBase"]]] = None,
# Type hints for this method would get rather complicated
# if we want to provide a more specific return type
) -> Any:
) -> "SchemaBase":
"""Construct class from a dictionary representation
Parameters
Expand Down

0 comments on commit 2732c8f

Please sign in to comment.