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

feat: Add the ability to pass regex flags #9274

Open
1 task done
SamEdwardes opened this issue May 30, 2024 · 2 comments
Open
1 task done

feat: Add the ability to pass regex flags #9274

SamEdwardes opened this issue May 30, 2024 · 2 comments
Labels
feature Features or general enhancements

Comments

@SamEdwardes
Copy link

Is your feature request related to a problem?

Depending on the backend, regex search my be handled differently. I would like the ability to be able to pass regex flags so that I have complete control over how the regex search is performed.

What is the motivation behind your request?

No response

Describe the solution you'd like

Here is an example of what the API could look like:

con = ibis.postgres.connect()
x = con.table("x")
ibis.to_sql(
    x
    .filter([x.body.re_search('kubernetes', flags='i')])
    .limit(10)

)

In this example, adding the i flag, which would make the search case insensitive.

What version of ibis are you running?

ibis-framework[postgres]==9.0.0

What backend(s) are you using, if any?

postgres, but I think it would be helpful to have this feature for all backends that support regex search.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@SamEdwardes SamEdwardes added the feature Features or general enhancements label May 30, 2024
@cpcloud
Copy link
Member

cpcloud commented May 31, 2024

One option if you must have the flags before we investigate here is to define a builtin UDF.

Something like this:

@ibis.udf.scalar.builtin(name="regexp_search")
def re_search(s, pattern, flags):
    ...

@SamEdwardes
Copy link
Author

Thanks for the suggestion @cpcloud! I do implement this I will report back here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features or general enhancements
Projects
Status: backlog
Development

No branches or pull requests

2 participants