Skip to content

Commit

Permalink
Fix remaining mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
binste committed Sep 24, 2023
1 parent 9ca1af9 commit 81f3948
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions altair/vegalite/v5/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,8 +1121,7 @@ def __repr__(self) -> str:
def __add__(self, other) -> "LayerChart":
if not isinstance(other, TopLevelMixin):
raise ValueError("Only Chart objects can be layered.")
# Too difficult to type check this
return layer(self, other) # type: ignore[arg-type]
return layer(self, other)

def __and__(self, other) -> "VConcatChart":
if not isinstance(other, TopLevelMixin):
Expand All @@ -1133,8 +1132,7 @@ def __and__(self, other) -> "VConcatChart":
def __or__(self, other) -> "HConcatChart":
if not isinstance(other, TopLevelMixin):
raise ValueError("Only Chart objects can be concatenated.")
# Too difficult to type check this
return hconcat(self, other) # type: ignore[arg-type]
return hconcat(self, other)

def repeat(
self,
Expand Down Expand Up @@ -1726,7 +1724,7 @@ def transform_joinaggregate(
joinaggregate: Union[
List[core.JoinAggregateFieldDef], UndefinedType
] = Undefined,
groupby: Union[str, UndefinedType] = Undefined,
groupby: Union[List[str], UndefinedType] = Undefined,
**kwargs: str,
) -> Self:
"""
Expand Down Expand Up @@ -1807,7 +1805,7 @@ def transform_filter(
Parameter,
core.PredicateComposition,
# E.g. {'not': alt.FieldRangePredicate(field='year', range=[1950, 1960])}
TypingDict[str, Union[core.Predicate, str, bool]],
TypingDict[str, Union[core.Predicate, str, list, bool]],
],
**kwargs,
) -> Self:
Expand Down Expand Up @@ -3214,7 +3212,7 @@ def add_selection(self, *selections) -> Self:
return self.add_params(*selections)


def concat(*charts: core.NonNormalizedSpec, **kwargs) -> ConcatChart:
def concat(*charts, **kwargs) -> ConcatChart:
"""Concatenate charts horizontally"""
return ConcatChart(concat=charts, **kwargs)

Expand Down Expand Up @@ -3313,7 +3311,7 @@ def add_selection(self, *selections) -> Self:
return self.add_params(*selections)


def hconcat(*charts: core.NonNormalizedSpec, **kwargs) -> HConcatChart:
def hconcat(*charts, **kwargs) -> HConcatChart:
"""Concatenate charts horizontally"""
return HConcatChart(hconcat=charts, **kwargs)

Expand Down Expand Up @@ -3532,7 +3530,7 @@ def add_selection(self, *selections) -> Self:
return self.add_params(*selections)


def layer(*charts: Union[core.LayerSpec, core.UnitSpec], **kwargs) -> LayerChart:
def layer(*charts, **kwargs) -> LayerChart:
"""layer multiple charts"""
return LayerChart(layer=charts, **kwargs)

Expand Down

0 comments on commit 81f3948

Please sign in to comment.