From e2557f09dedab32106e49bb475c9145eaea14c0f Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sat, 20 Jul 2024 08:09:49 -0400 Subject: [PATCH] refactor(selectors): remove inefficient `positions` API --- ibis/selectors.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/ibis/selectors.py b/ibis/selectors.py index 2f51a1592363b..6af620c6c0f6a 100644 --- a/ibis/selectors.py +++ b/ibis/selectors.py @@ -89,24 +89,6 @@ def expand(self, table: ir.Table) -> Sequence[ir.Value]: """ - def positions(self, table: ir.Table) -> Sequence[int]: - """Expand `table` into column indices that match the selector. - - Parameters - ---------- - table - An ibis table expression - - Returns - ------- - Sequence[int] - A sequence of column indices where the selector matches - - """ - raise NotImplementedError( - f"`positions` doesn't make sense for {self.__class__.__name__} selector" - ) - class Predicate(Selector): predicate: Callable[[ir.Value], bool] @@ -122,11 +104,6 @@ def expand(self, table: ir.Table) -> Sequence[ir.Value]: """ return [col for column in table.columns if self.predicate(col := table[column])] - def positions(self, table: ir.Table) -> Sequence[int]: - return [ - i for i, column in enumerate(table.columns) if self.predicate(table[column]) - ] - def __and__(self, other: Selector) -> Predicate: """Compute the conjunction of two `Selector`s.