Skip to content

Commit

Permalink
feat(pandas): implement StringReplace execution
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Sep 13, 2022
1 parent 1389f4b commit 578795f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ibis/backends/pandas/execution/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,13 @@ def execute_series_right_gb(op, data, nchars, **kwargs):
)


@execute_node.register(
ops.StringReplace, pd.Series, (pd.Series, str), (pd.Series, str)
)
def execute_series_string_replace(_, data, needle, replacement, **kwargs):
return data.str.replace(needle, replacement)


@execute_node.register(ops.StringJoin, (pd.Series, str), list)
def execute_series_join_scalar_sep(op, sep, data, **kwargs):
return reduce(lambda x, y: x + sep + y, data)
Expand Down

0 comments on commit 578795f

Please sign in to comment.