Skip to content

Commit 1dc15b7

Browse files
committed
refactor: Make SelectionPredicateComposition an alias of core.PredicateComposition
- Ensures backwards compat if anyone was using this directly - Existing tests not breaking is confirmation that this is safe
1 parent fdc635a commit 1dc15b7

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

altair/vegalite/v5/api.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -457,15 +457,7 @@ def __getitem__(self, field_name: str) -> GetItemExpression:
457457

458458

459459
# Enables use of ~, &, | with compositions of selection objects.
460-
class SelectionPredicateComposition(core.PredicateComposition):
461-
def __invert__(self) -> SelectionPredicateComposition:
462-
return SelectionPredicateComposition({"not": self.to_dict()})
463-
464-
def __and__(self, other: SchemaBase) -> SelectionPredicateComposition:
465-
return SelectionPredicateComposition({"and": [self.to_dict(), other.to_dict()]})
466-
467-
def __or__(self, other: SchemaBase) -> SelectionPredicateComposition:
468-
return SelectionPredicateComposition({"or": [self.to_dict(), other.to_dict()]})
460+
SelectionPredicateComposition = core.PredicateComposition
469461

470462

471463
class ParameterExpression(_expr_core.OperatorMixin):

0 commit comments

Comments
 (0)