[SPARK-58058][PYTHON][TESTS] Split slow PySpark test suites into smaller modules#57155
Closed
HyukjinKwon wants to merge 1 commit into
Closed
[SPARK-58058][PYTHON][TESTS] Split slow PySpark test suites into smaller modules#57155HyukjinKwon wants to merge 1 commit into
HyukjinKwon wants to merge 1 commit into
Conversation
Member
Author
CI timing results (run on this PR)All split modules pass. The one red job ( Measured per-module durations (classic / Spark Connect):
Each split lowers the longest single-module wall-clock via parallelism. |
…ler modules ### What changes were proposed in this pull request? This PR splits several large/slow PySpark test suites into smaller modules so they run as separate test targets and parallelize better, reducing wall-clock time. No test logic is changed; test methods are only relocated. Each split follows the existing convention already used in the repo (e.g. `test_split_apply_*`, `test_stat_*`). The following suites are split, each with a matching Spark Connect parity module: - `pyspark.sql.tests.pandas.test_pandas_cogrouped_map`: move the heavier, self-contained tests (`test_with_window_function`, `test_with_local_data`, `test_arrow_batch_slicing`, `test_cogroup_apply_in_pandas_with_logging`) into a new `test_pandas_cogrouped_map_misc` module. - `pyspark.sql.tests.arrow.test_arrow_cogrouped_map`: extract shared helpers into `CogroupedMapInArrowTestsFuncMixin` and move the heavier tests into a new `test_arrow_cogrouped_map_misc` module. - `pyspark.pandas.tests.data_type_ops.test_num_ops`: move `IntegralExtensionOpsTestsMixin` and `FractionalExtensionOpsTestsMixin` into their own modules, and further split the heavier `astype` and comparison (`eq`/`ne`/`lt`/`le`/`gt`/`ge`) tests of each into dedicated `*_astype_cmp` modules so the pieces are more evenly balanced. - `pyspark.pandas.tests.groupby.test_stat`: move `test_median` into a new `test_stat_median` module. - `pyspark.pandas.tests.groupby.test_split_apply`: move the `mean` case into a new `test_split_apply_mean` module. New modules are registered in `dev/sparktestsupport/modules.py`. ### Why are the changes needed? These suites are slow in CI. Splitting them lets the test runner schedule the pieces in parallel, lowering total wall-clock time without dropping coverage. ### Does this PR introduce _any_ user-facing change? No. Test-only change. ### How was this patch tested? Existing tests, only relocated across modules. Verified that the total number of test methods is unchanged for each split suite, that all new and modified modules import and collect, and that `flake8` passes. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Cursor
8e43895 to
72c8d83
Compare
dongjoon-hyun
approved these changes
Jul 9, 2026
Member
|
I also agree that |
HyukjinKwon
added a commit
that referenced
this pull request
Jul 9, 2026
…er modules ### What changes were proposed in this pull request? This PR splits several large/slow PySpark test suites into smaller modules so they run as separate test targets and parallelize better, reducing wall-clock time. No test logic is changed; test methods are only relocated, following the existing convention already used in the repo (e.g. `test_split_apply_*`, `test_stat_*`). The following suites are split, each with a matching Spark Connect parity module: - `pyspark.sql.tests.pandas.test_pandas_cogrouped_map`: move the heavier, self-contained tests (`test_with_window_function`, `test_with_local_data`, `test_arrow_batch_slicing`, `test_cogroup_apply_in_pandas_with_logging`) into a new `test_pandas_cogrouped_map_misc` module. - `pyspark.sql.tests.arrow.test_arrow_cogrouped_map`: extract shared helpers into `CogroupedMapInArrowTestsFuncMixin` and move the heavier tests into a new `test_arrow_cogrouped_map_misc` module. - `pyspark.pandas.tests.data_type_ops.test_num_ops`: move `IntegralExtensionOpsTestsMixin` and `FractionalExtensionOpsTestsMixin` into their own modules. - `pyspark.pandas.tests.groupby.test_stat`: move `test_median` into a new `test_stat_median` module. - `pyspark.pandas.tests.groupby.test_split_apply`: move the `mean` case into a new `test_split_apply_mean` module. New modules are registered in `dev/sparktestsupport/modules.py`. ### Why are the changes needed? These suites are slow in CI. Splitting them lets the test runner schedule the pieces in parallel, lowering total wall-clock time without dropping coverage. ### Does this PR introduce _any_ user-facing change? No. Test-only change. ### How was this patch tested? Existing tests, only relocated across modules. Verified that the total number of test methods is unchanged for each split suite, that all new and modified modules import and collect, and that `flake8` passes. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Cursor Closes #57155 from HyukjinKwon/hyukjin/split-slow-pyspark-tests. Authored-by: Hyukjin Kwon <gurwls223@apache.org> Signed-off-by: Hyukjin Kwon <hyukjin.kwon@databricks.com> (cherry picked from commit 79f6dfa) Signed-off-by: Hyukjin Kwon <hyukjin.kwon@databricks.com>
Member
Author
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 splits several large/slow PySpark test suites into smaller modules so
they run as separate test targets and parallelize better, reducing wall-clock
time. No test logic is changed; test methods are only relocated, following the
existing convention already used in the repo (e.g.
test_split_apply_*,test_stat_*).The following suites are split, each with a matching Spark Connect parity module:
pyspark.sql.tests.pandas.test_pandas_cogrouped_map: move the heavier,self-contained tests (
test_with_window_function,test_with_local_data,test_arrow_batch_slicing,test_cogroup_apply_in_pandas_with_logging) intoa new
test_pandas_cogrouped_map_miscmodule.pyspark.sql.tests.arrow.test_arrow_cogrouped_map: extract shared helpersinto
CogroupedMapInArrowTestsFuncMixinand move the heavier tests into a newtest_arrow_cogrouped_map_miscmodule.pyspark.pandas.tests.data_type_ops.test_num_ops: moveIntegralExtensionOpsTestsMixinandFractionalExtensionOpsTestsMixinintotheir own modules.
pyspark.pandas.tests.groupby.test_stat: movetest_medianinto a newtest_stat_medianmodule.pyspark.pandas.tests.groupby.test_split_apply: move themeancase into anew
test_split_apply_meanmodule.New modules are registered in
dev/sparktestsupport/modules.py.Why are the changes needed?
These suites are slow in CI. Splitting them lets the test runner schedule the
pieces in parallel, lowering total wall-clock time without dropping coverage.
Does this PR introduce any user-facing change?
No. Test-only change.
How was this patch tested?
Existing tests, only relocated across modules. Verified that the total number
of test methods is unchanged for each split suite, that all new and modified
modules import and collect, and that
flake8passes.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Cursor