Skip to content

Commit

Permalink
feat(datafusion): implement ops.StrRight
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztof-kwitt authored and cpcloud committed Feb 16, 2023
1 parent 8099014 commit 016a082
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ibis/backends/datafusion/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,11 @@ def string_starts_with(op):
return df.functions.starts_with(translate(op.arg), translate(op.start))


@translate.register(ops.StrRight)
def string_right(op):
return df.functions.right(translate(op.arg), translate(op.nchars))


@translate.register(ops.RegexExtract)
def regex_extract(op):
arg = translate(op.arg)
Expand Down
3 changes: 0 additions & 3 deletions ibis/backends/tests/test_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,6 @@ def test_string_col_is_unicode(alltypes, df):
lambda t: t.date_string_col.right(2),
lambda t: t.date_string_col.str[-2:],
id="right",
marks=pytest.mark.notimpl(
["datafusion"], raises=com.OperationNotDefinedError
),
),
param(
lambda t: t.date_string_col[1:3],
Expand Down

0 comments on commit 016a082

Please sign in to comment.