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

[SPARK-45159][PYTHON] Handle named arguments only when necessary #42915

Closed
wants to merge 2 commits into from

Conversation

ueshin
Copy link
Member

@ueshin ueshin commented Sep 13, 2023

What changes were proposed in this pull request?

Handles named arguments only when necessary.

Why are the changes needed?

Constructing kwargs as dict could be expensive. It should be done only when necessary.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing tests.

Was this patch authored or co-authored using generative AI tooling?

No.

@ueshin
Copy link
Member Author

ueshin commented Sep 14, 2023

@HyukjinKwon
Copy link
Member

Merged to master.

check_return_value(res)
yield verify_result(pd.DataFrame(res)), arrow_return_type

return evaluate

eval = wrap_arrow_udtf(getattr(udtf, "eval"), return_type)
eval_func_kwargs_support, args_kwargs_offsets = wrap_kwargs_support(
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be really good to comment here on why we need to wrap the kwargs separately. This can provide valuable context for those who work on this code in the future. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants