[SPARK-58087][PYTHON][DOCS] Document accepted input and return types in the PySpark functions API#57185
Open
HyukjinKwon wants to merge 2 commits into
Open
[SPARK-58087][PYTHON][DOCS] Document accepted input and return types in the PySpark functions API#57185HyukjinKwon wants to merge 2 commits into
HyukjinKwon wants to merge 2 commits into
Conversation
dongjoon-hyun
requested changes
Jul 10, 2026
Member
Author
|
Thank you @dongjoon-hyun for review. Let me try to take a look throughoutly. |
HyukjinKwon
marked this pull request as draft
July 12, 2026 22:08
HyukjinKwon
force-pushed
the
split-func-types-python
branch
from
July 12, 2026 22:18
7cda100 to
241f910
Compare
…in the PySpark functions API ### What changes were proposed in this pull request? This documents, for every built-in function in the PySpark `functions` API (`builtin.py`), the accepted input type of each argument (`Parameters`) and the return type of each function (`Returns`), using the numeric umbrella where numeric subtypes cast in and `timestamp` for TIMESTAMP_NTZ in type phrases. Subtask of SPARK-57999, split out from apache#57079 for reviewability. This PR covers only the PySpark `builtin.py` surface. ### Why are the changes needed? The PySpark `functions` docstrings previously had no per-argument type information for most functions. This fills that gap. ### Does this PR introduce _any_ user-facing change? Yes, documentation only. No behavioral or API change. ### How was this patch tested? Python lint (flake8 + black) and the docstring doctests pass. Types were derived from and verified against the analyzer's behavior and each expression's `inputTypes` / `dataType`. Co-authored-by: Isaac
HyukjinKwon
force-pushed
the
split-func-types-python
branch
from
July 13, 2026 00:01
241f910 to
d9b102b
Compare
HyukjinKwon
marked this pull request as ready for review
July 13, 2026 06:26
dongjoon-hyun
left a comment
Member
There was a problem hiding this comment.
For kll_sketch_get_quantile_bigint/_float/_double, kll_sketch_get_rank_*, the return type is sometimes array.
… to_char constant note, and broaden date extractor input types Co-authored-by: Isaac
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?
This documents, for every built-in function in the PySpark
functionsAPI (builtin.py), theaccepted input type of each argument (
Parameters) and the return type of each function(
Returns), using the numeric umbrella where numeric subtypes cast in andtimestampforTIMESTAMP_NTZ in type phrases.
Subtask of SPARK-57999, split out from #57079 for reviewability. This PR covers only
the PySpark
builtin.pysurface.Why are the changes needed?
The PySpark
functionsdocstrings previously had no per-argument type information for mostfunctions. This fills that gap.
Does this PR introduce any user-facing change?
Yes, documentation only. No behavioral or API change.
How was this patch tested?
Python lint (flake8 + black) and the docstring doctests pass. Types were derived from and verified
against the analyzer's behavior and each expression's
inputTypes/dataType.Co-authored-by: Isaac