[SPARK-44918][SQL][PYTHON] Support named arguments in scalar Python/Pandas UDFs#42617
Closed
ueshin wants to merge 3 commits intoapache:masterfrom
Closed
[SPARK-44918][SQL][PYTHON] Support named arguments in scalar Python/Pandas UDFs#42617ueshin wants to merge 3 commits intoapache:masterfrom
ueshin wants to merge 3 commits intoapache:masterfrom
Conversation
Member
Author
dtenedor
approved these changes
Aug 23, 2023
Contributor
dtenedor
left a comment
There was a problem hiding this comment.
Generally LGTM. I left one suggestion for a testing idea. Thanks a lot for adding this feature!!
sql/core/src/main/scala/org/apache/spark/sql/execution/python/PythonUDFRunner.scala
Outdated
Show resolved
Hide resolved
| /* | ||
| * Check if the named arguments: | ||
| * - don't have duplicated names | ||
| * - don't contain positional arguments |
Contributor
There was a problem hiding this comment.
Suggested change
| * - don't contain positional arguments | |
| * - don't contain positional arguments after named arguments | |
| * - all map to valid argument names from the function declaration |
Member
Author
There was a problem hiding this comment.
The third item is not right for Python UDF/UDTF. Currently it relies on Python.
HyukjinKwon
approved these changes
Aug 23, 2023
allisonwang-db
approved these changes
Aug 24, 2023
|
|
||
| inputRDD.mapPartitions { iter => | ||
| val context = TaskContext.get() | ||
| val contextAwareIterator = new ContextAwareIterator(context, iter) |
Member
Author
|
Thanks! merging to master. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Supports named arguments in scalar Python/Pandas UDF.
For example:
or:
Why are the changes needed?
Now that named arguments support was added (#41796, #42020).
Scalar Python/Pandas UDFs can support it.
Does this PR introduce any user-facing change?
Yes, named arguments will be available for scalar Python/Pandas UDFs.
How was this patch tested?
Added related tests.
Was this patch authored or co-authored using generative AI tooling?
No.