From d12a74117ec201fc096f5e27328d4e50ea493f84 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Sat, 6 Jul 2024 18:43:37 +0100 Subject: [PATCH] feat: un-special case `Then` --- altair/utils/core.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/altair/utils/core.py b/altair/utils/core.py index 32c6ee5f3..61d74fa16 100644 --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -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", @@ -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: