Skip to content

Commit

Permalink
feat(pandas): implement Contains with a group by
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Aug 2, 2022
1 parent 45612ce commit c534848
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ibis/backends/pandas/execution/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,17 @@ def execute_node_contains_series_sequence(op, data, elements, **kwargs):
return data.isin(elements)


@execute_node.register(
ops.Contains,
SeriesGroupBy,
(collections.abc.Sequence, collections.abc.Set, pd.Series),
)
def execute_node_contains_series_group_by_sequence(
op, data, elements, **kwargs
):
return data.obj.isin(elements).groupby(data.grouper.groupings)


@execute_node.register(
ops.NotContains,
pd.Series,
Expand Down

0 comments on commit c534848

Please sign in to comment.