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

Add missing arguments to Parameter and add type hints #3173

Merged
merged 3 commits into from
Sep 21, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix type hints
  • Loading branch information
binste committed Aug 29, 2023
commit 9a41f9aa195aed81f4657ce1c8b59a151d01ed18
6 changes: 3 additions & 3 deletions altair/vegalite/v5/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from toolz.curried import pipe as _pipe
import itertools
import sys
from typing import cast, List, Optional, Any, Iterable, Union, Literal, Dict
from typing import cast, List, Optional, Any, Iterable, Union, Literal

# Have to rename it here as else it overlaps with schema.core.Type
from typing import Type as TypingType
Expand Down Expand Up @@ -219,7 +219,7 @@ def ref(self) -> dict:
"'ref' is deprecated. No need to call '.ref()' anymore."
return self.to_dict()

def to_dict(self) -> Dict[str, Union[str, dict]]:
def to_dict(self) -> TypingDict[str, Union[str, dict]]:
if self.param_type == "variable":
return {"expr": self.name}
elif self.param_type == "selection":
Expand Down Expand Up @@ -1744,7 +1744,7 @@ def transform_filter(self, filter, **kwargs) -> Self:

"""
if isinstance(filter, Parameter):
new_filter = {"param": filter.name}
new_filter: TypingDict[str, Union[bool, str]] = {"param": filter.name}
if "empty" in kwargs:
new_filter["empty"] = kwargs.pop("empty")
elif isinstance(filter.empty, bool):
Expand Down
Loading