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 python bindings for ends_with function #693

Merged
merged 5 commits into from
May 15, 2024

Conversation

richtia
Copy link
Contributor

@richtia richtia commented May 13, 2024

Which issue does this PR close?

ends_with function is missing from datafusion_python

@andygrove
Copy link
Member

@richtia It looks like ends_with is not available in DataFusion 37.x.x, so you will probably need to wait until #691 is merged

@richtia
Copy link
Contributor Author

richtia commented May 14, 2024

Looks like I accidentally deleted a line i changed on my rebase. added back the wrap pyfunction.

src/functions.rs Outdated
@@ -474,6 +474,7 @@ expr_fn!(
);
expr_fn!(sqrt, num);
expr_fn!(starts_with, arg1 arg2, "Returns true if string starts with prefix.");
expr_fn!(ends_with, arg1 arg2, "Returns true if string ends with suffix.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably match the argument names to upstream: string suffix

(I assume you just matched what starts_with has. That was either my error as I made the initial port or the upstream UDF changed)

https://docs.rs/datafusion/latest/datafusion/functions/expr_fn/fn.ends_with.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated! Also updated the argument names for starts_with

Copy link
Contributor Author

@richtia richtia May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually...looks like the upstream for starts_with is arg1, and arg2...should i revert it back?

https://docs.rs/datafusion/latest/datafusion/functions/expr_fn/fn.starts_with.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:D yea - UDF's are going through rapid iteration in upstream datafusion, so the conventions are still being ironed out.

Copy link
Contributor

@Michael-J-Ward Michael-J-Ward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with clarifying argument names for starts_with. I assume upstream will get switched to this eventually.

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @richtia. There is a merge conflict that needs fixing though.

@richtia
Copy link
Contributor Author

richtia commented May 14, 2024

LGTM. Thanks @richtia. There is a merge conflict that needs fixing though.

Just rebased

@andygrove andygrove merged commit 344ebad into apache:main May 15, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants