Skip to content

[SPARK-58243][PYTHON] Remove unused ApplyInPandasWithStateSerializer#57409

Closed
Yicong-Huang wants to merge 1 commit into
apache:masterfrom
Yicong-Huang:SPARK-58243
Closed

[SPARK-58243][PYTHON] Remove unused ApplyInPandasWithStateSerializer#57409
Yicong-Huang wants to merge 1 commit into
apache:masterfrom
Yicong-Huang:SPARK-58243

Conversation

@Yicong-Huang

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Delete the now-unused ApplyInPandasWithStateSerializer. After SPARK-58189 refactored SQL_GROUPED_MAP_PANDAS_UDF_WITH_STATE to extract its logic into read_udfs() (state management and Pandas conversion moved into the wrapper) and use ArrowStreamSerializer directly, this class is dead code. Imports left unused by the deletion (CPickleSerializer, to_arrow_type, StringType, BinaryType, LongType, IntegerType) are removed, and a stale class-name reference in a benchmark docstring is reworded.

Part of SPARK-55384.

Why are the changes needed?

The class is no longer referenced anywhere; removing it and its dead imports keeps serializers.py lean.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing tests. No behavior change. pyspark.sql.tests.pandas.test_pandas_grouped_map_with_state passes.

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

No.

@uros-b

uros-b commented Jul 22, 2026

Copy link
Copy Markdown
Member

Thank you @Yicong-Huang!

Yicong-Huang added a commit that referenced this pull request Jul 22, 2026
### What changes were proposed in this pull request?

Delete the now-unused `ApplyInPandasWithStateSerializer`. After SPARK-58189 refactored `SQL_GROUPED_MAP_PANDAS_UDF_WITH_STATE` to extract its logic into `read_udfs()` (state management and Pandas conversion moved into the wrapper) and use `ArrowStreamSerializer` directly, this class is dead code. Imports left unused by the deletion (`CPickleSerializer`, `to_arrow_type`, `StringType`, `BinaryType`, `LongType`, `IntegerType`) are removed, and a stale class-name reference in a benchmark docstring is reworded.

Part of SPARK-55384.

### Why are the changes needed?

The class is no longer referenced anywhere; removing it and its dead imports keeps `serializers.py` lean.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing tests. No behavior change. `pyspark.sql.tests.pandas.test_pandas_grouped_map_with_state` passes.

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

No.

Closes #57409 from Yicong-Huang/SPARK-58243.

Authored-by: Yicong Huang <17627829+Yicong-Huang@users.noreply.github.com>
Signed-off-by: Yicong-Huang <17627829+Yicong-Huang@users.noreply.github.com>
(cherry picked from commit 600e361)
Signed-off-by: Yicong-Huang <17627829+Yicong-Huang@users.noreply.github.com>
@Yicong-Huang

Copy link
Copy Markdown
Contributor Author

Merge Summary:

Posted by merge_spark_pr.py

@Yicong-Huang

Copy link
Copy Markdown
Contributor Author

Thanks @HyukjinKwon @uros-b !

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants