[SPARK-47998][PS] Support native pandas inputs in pandas-on-Spark concat#55561
Open
hvph-uyen wants to merge 3 commits intoapache:masterfrom
Open
[SPARK-47998][PS] Support native pandas inputs in pandas-on-Spark concat#55561hvph-uyen wants to merge 3 commits intoapache:masterfrom
hvph-uyen wants to merge 3 commits intoapache:masterfrom
Conversation
Member
|
I think we should not do this. Otherwise, we will have to fix all API surface to support pandas instances |
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 PR updates pandas-on-Spark
concatso that native pandasDataFrameandSeriesobjects are accepted when they are passed inside the input iterable.It also fixes the error message for unsupported inputs so that it reports the actual invalid element type instead of the outer container type.
The existing behavior for bare inputs such as
ps.concat(pdf)andps.concat(pser)is preserved.Why are the changes needed?
Currently,
ps.concatrejects native pandas objects even when they can be converted in the iterable case.Also, the current error message is misleading because it can report
listinstead of the actual invalid input type.Does this PR introduce any user-facing change?
Yes.
Before this change,
ps.concat([pdf, pdf])rejected native pandas inputs, and unsupported input errors could reportlistinstead of the actual invalid element type.After this change, native pandas
DataFrameandSeriesinputs are accepted in the iterable case, and unsupported input errors report the actual invalid element type.How was this patch tested?
pyspark.pandas.tests.test_namespace.python/run-tests --python-executables python3 --testnames pyspark.pandas.tests.test_namespaceWas this patch authored or co-authored using generative AI tooling?
Generated-by: Codex (GPT-5)
Generative AI tooling was used to help inspect the issue, understand the relevant Spark codebase. The final patch was manually reviewed and tested before submission.