Skip to content

Commit

Permalink
feat(datafusion): implement ops.StringAscii
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 2fe3fc4 commit b1d7672
Show file tree
Hide file tree
Showing 2 changed files with 6 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 @@ -476,6 +476,11 @@ def string_translate(op):
return df.functions.translate(*map(translate, op.args))


@translate.register(ops.StringAscii)
def string_ascii(op):
return df.functions.ascii(translate(op.arg))


@translate.register(ops.RegexExtract)
def regex_extract(op):
arg = translate(op.arg)
Expand Down
4 changes: 1 addition & 3 deletions ibis/backends/tests/test_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,7 @@ def test_string_col_is_unicode(alltypes, df):
lambda t: t.string_col.ascii_str(),
lambda t: t.string_col.map(ord).astype('int32'),
id='ascii_str',
marks=pytest.mark.notimpl(
["datafusion", "polars"], raises=com.OperationNotDefinedError
),
marks=pytest.mark.notimpl(["polars"], raises=com.OperationNotDefinedError),
),
param(
lambda t: t.string_col.length(),
Expand Down

0 comments on commit b1d7672

Please sign in to comment.