[SPARK-57452][DOCS] Add missing 4.2 behavior changes to migration guides#56553
Open
cloud-fan wants to merge 4 commits into
Open
[SPARK-57452][DOCS] Add missing 4.2 behavior changes to migration guides#56553cloud-fan wants to merge 4 commits into
cloud-fan wants to merge 4 commits into
Conversation
Adds migration-guide entries for behavior changes that shipped in Spark 4.2 but were missing from the migration guides, covering only changes that require user action to migrate. Co-authored-by: Isaac
Contributor
Author
cloud-fan
commented
Jun 17, 2026
| * In Spark 4.2, regular Python UDFs are Arrow-optimized by default. The configuration ``spark.sql.execution.pythonUDF.arrow.enabled`` now defaults to true. To restore the legacy behavior for Python UDF execution, set ``spark.sql.execution.pythonUDF.arrow.enabled`` to ``false``. | ||
| * In Spark 4.2, regular Python UDTFs are Arrow-optimized by default. The configuration ``spark.sql.execution.pythonUDTF.arrow.enabled`` now defaults to true. To restore the legacy behavior for Python UDTF execution, set ``spark.sql.execution.pythonUDTF.arrow.enabled`` to ``false``. | ||
| * In Spark 4.2, PyPy is no longer officially supported. Run PySpark on CPython instead. | ||
| * In Spark 4.2, the minimum supported version of pandas for Spark Connect has been raised to 2.2.0. Upgrade pandas to 2.2.0 or later. |
Contributor
Author
There was a problem hiding this comment.
do we need this or pyspark already have a doc page for version bumps? cc @HyukjinKwon @gaogaotiantian
Member
There was a problem hiding this comment.
We have the page https://github.com/apache/spark/blob/master/python/docs/source/getting_started/install.rst#spark-connect maybe we need to update there too
The change is about a SQL UDF parameter shadowing a parameterless built-in, not a registered UDF named like a built-in. Describe the affected functions and the legacy restore config. Co-authored-by: Isaac
HyukjinKwon
approved these changes
Jun 17, 2026
SPARK-55314 changed Observation.get to propagate the underlying error on metric collection failure for both Scala (SparkRuntimeException) and Python (PySparkException), via the shared sql/api Observation. It is a cross-language Dataset API change, not PySpark-only, so it belongs in the SQL migration guide. Co-authored-by: Isaac
- Drop the pandas 2.2.0 minimum entry: it shipped in Spark 4.1 (SPARK-52840) and is PySpark-wide, not Connect-only, so it does not belong in the 4.2 guide. - SET CATALOG: use a string literal (not quoting) to force literal interpretation; backtick-quoted names follow the same resolution path. - Python Data Source: only the Arrow column-type check is new in 4.2 (SPARK-55583); count/name mismatches already raised the error. - Streaming offset entry: narrow to SimpleDataSourceStreamReader and the SIMPLE_STREAM_READER_OFFSET_DID_NOT_ADVANCE error. - Streaming checkpoint: name the error and add the restore config spark.sql.streaming.checkpoint.verifyMetadataExists.enabled (SPARK-55058). - CTE: note it is parse-time, DUPLICATED_CTE_NAMES, and independent of spark.sql.caseSensitive. Minor wording fixes for numpy/pandas-UDF/drop. Co-authored-by: Isaac
dongjoon-hyun
approved these changes
Jun 17, 2026
huaxingao
approved these changes
Jun 17, 2026
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?
An audit of Spark 4.2 commits (SPARK-57452) found a number of user-facing behavior changes that were not documented in the migration guides. This PR adds entries for the subset of those changes that require a user to take action to migrate, across three guides:
PySpark (
python/docs/source/migration_guide/pyspark_upgrade.rst):createDataFramefrom a NumPyndarraynow requires PyArrow and may infer a different schema.Intdtype instead offloat64.Observation.getraises on metric collection failure instead of returning an empty dictionary.DataFrame.drop/Series.drop(pandas API on Spark) raiseKeyErrorif any label is missing.DATA_SOURCE_RETURN_SCHEMA_MISMATCHon schema mismatch.SQL (
docs/sql-migration-guide.md):WITHclause are detected case-insensitively.NATURAL JOINhonorsspark.sql.caseSensitivewhen choosing join columns.SET CATALOG <name>resolves a bare name as a session variable first.Structured Streaming (
docs/streaming/ss-migration-guide.md):Behavior changes that are purely cosmetic/UI, internal, additive, or correctness fixes requiring no user action were intentionally excluded.
Why are the changes needed?
Without these entries, users upgrading to Spark 4.2 can hit silent result changes, new errors on previously-valid input, or dependency/environment requirements with no documented guidance on how to migrate.
Does this PR introduce any user-facing change?
No. This is a documentation-only change.
How was this patch tested?
Documentation-only change; verified by review of the rendered Markdown/reStructuredText.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8)