Skip to content

Commit 7b72b5f

Browse files
committed
fix: unbreak __deepcopy__
vega/altair#3553
1 parent 14b1d6c commit 7b72b5f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/narwhals/_plan/altair/expression.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import math
1212
import operator
1313
from collections.abc import Callable, Iterable, Mapping
14-
from typing import TYPE_CHECKING, Any, Final, Literal, TypeAlias, TypeVar
14+
from typing import TYPE_CHECKING, Any, Final, Literal, TypeAlias, TypeVar, final
1515

1616
from altair.expr import core as alt_ir
1717

@@ -50,6 +50,7 @@
5050
_COMMA = ","
5151

5252

53+
@final
5354
class AltExprStr(alt_ir.Expression):
5455
"""Extensions to altair's expressions.
5556
@@ -70,6 +71,12 @@ def __repr__(self) -> VegaExpr:
7071

7172
__str__ = __repr__
7273

74+
def __copy__(self) -> AltExprStr:
75+
return self
76+
77+
def __deepcopy__(self, memo: Any) -> AltExprStr:
78+
return self
79+
7380
@staticmethod
7481
def list_expr(exprs: Iterable[alt_ir.Expression], /) -> AltExprStr:
7582
"""Create a JS array literal from expressions.

0 commit comments

Comments
 (0)