Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: incorrect mapping of *strip to *trim #1224

Open
ingomueller-net opened this issue Dec 11, 2024 · 0 comments
Open

bug: incorrect mapping of *strip to *trim #1224

ingomueller-net opened this issue Dec 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ingomueller-net
Copy link

What happened?

Ibis' strip, lstrip, and rstrip take no additional arguments and remove whitespace; Substrait's trim, ltrim, and rtrim, however, do take an additional argument, which specifies the characters that should be removed. Currently, *strip is mapped to *trim as is, leading to an exception because to signature of the form ('str',) is found for *trim. Instead, we should map to a call to *trim that builds a character set of whitespace characters.

Example:

def trim_expr(nation):
    new_col = nation.n_name.strip().name("trim_N_NAME")
    return nation[nation.n_name, new_col]

What version of ibis-substrait are you using?

ibis-framework==9.5.0
ibis-substrait==4.0.1

What substrait consumer(s) are you using, if any?

No response

Relevant log output

ValueError: No matching extension type found for function ltrim with input types ('str',)
@ingomueller-net ingomueller-net added the bug Something isn't working label Dec 11, 2024
ingomueller-net added a commit to ingomueller-net/substrait-consumer-testing that referenced this issue Dec 11, 2024
This PR fixes the usage of Ibis` `*trim` functions, which do not take
any arguments but always remove whitespace instead. Unfortunately, this
only changes the error that is produced since `*trim` is currently
translated to Substrait correctly (see
ibis-project/ibis-substrait#1224).

Signed-off-by: Ingo Müller <ingomueller@google.com>
ingomueller-net added a commit to ingomueller-net/substrait-consumer-testing that referenced this issue Dec 11, 2024
This PR fixes the usage of Ibis` `*trim` functions, which do not take
any arguments but always remove whitespace instead. Unfortunately, this
only changes the error that is produced since `*trim` is currently
translated to Substrait correctly (see
ibis-project/ibis-substrait#1224).

Signed-off-by: Ingo Müller <ingomueller@google.com>
ingomueller-net added a commit to ingomueller-net/substrait-consumer-testing that referenced this issue Dec 11, 2024
This PR fixes the usage of Ibis` `*trim` functions, which do not take
any arguments but always remove whitespace instead. Unfortunately, this
only changes the error that is produced since `*trim` is currently
translated to Substrait correctly (see
ibis-project/ibis-substrait#1224).

Signed-off-by: Ingo Müller <ingomueller@google.com>
ingomueller-net added a commit to substrait-io/consumer-testing that referenced this issue Dec 11, 2024
This PR fixes the usage of Ibis` `*trim` functions, which do not take
any arguments but always remove whitespace instead. Unfortunately, this
only changes the error that is produced since `*trim` is currently
translated to Substrait correctly (see
ibis-project/ibis-substrait#1224).

Signed-off-by: Ingo Müller <ingomueller@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: backlog
Development

No branches or pull requests

1 participant