Skip to content

Commit

Permalink
feat: un-special case Then
Browse files Browse the repository at this point in the history
  • Loading branch information
dangotbanned committed Jul 6, 2024
1 parent 8f66b7a commit d12a741
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions altair/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,6 @@ def __dataframe__(
) -> DfiDataFrame: ...


@runtime_checkable
class _ThenLike(Protocol):
# Helper for extracting the intermediate representation,
# whilst still allowing further clauses to be added.
def otherwise(self, *args: Any, **kwargs: Any) -> Any: ...
def to_dict(self, *args: Any, **kwargs: Any) -> dict[str, Any]: ...
def when(self, *args: Any, **kwargs: Any) -> Any: ...


TYPECODE_MAP = {
"ordinal": "O",
"nominal": "N",
Expand Down Expand Up @@ -834,10 +825,6 @@ def _wrap_in_channel(self, obj: Any, encoding: str, /):
obj = {"shorthand": obj}
elif isinstance(obj, (list, tuple)):
return [self._wrap_in_channel(el, encoding) for el in obj]
elif isinstance(obj, _ThenLike):
# NOTE: Temporary solution while `when-then-otherwise` is not
# related to any other `altair` classes.
obj = obj.to_dict()
if channel := self.name_to_channel.get(encoding):
tp = channel["value" if "value" in obj else "field"]
try:
Expand Down

0 comments on commit d12a741

Please sign in to comment.