Skip to content

Commit

Permalink
[SPARK-48232][PYTHON][TESTS] Fix 'pyspark.sql.tests.connect.test_conn…
Browse files Browse the repository at this point in the history
…ect_session' in Python 3.12 build

### What changes were proposed in this pull request?

This PR avoids importing `scipy.sparse` directly which hangs indeterministically specifically with Python 3.12

### Why are the changes needed?

To fix the build with Python 3.12 https://github.com/apache/spark/actions/runs/9022174253/job/24804919747
I was able to reproduce this in my local but a bit indeterministic.

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

No, test-only.

### How was this patch tested?

Manually tested in my local.

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

No.

Closes apache#46522 from HyukjinKwon/SPARK-48232.

Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
  • Loading branch information
HyukjinKwon committed May 10, 2024
1 parent d815118 commit 256a238
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/pyspark/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
have_scipy = False
have_numpy = False
try:
import scipy.sparse # noqa: F401
import scipy # noqa: F401

have_scipy = True
except ImportError:
Expand Down

0 comments on commit 256a238

Please sign in to comment.