HyukjinKwon opened a new pull request, #56654:
URL: https://github.com/apache/spark/pull/56654

   ### What changes were proposed in this pull request?
   
   Guard the Spark Connect (grpc-requiring) imports in two Connect 
SQLContext/HiveContext test
   modules behind `should_test_connect`, so the modules stay importable on 
builds where `grpcio`
   is not installed:
   
   - `python/pyspark/sql/tests/connect/test_connect_context.py`
   - `python/pyspark/sql/tests/connect/test_parity_sql_context.py`
   
   The grpc-backed `pyspark.sql.connect.context` import now happens only `if 
should_test_connect:`.
   The test classes already extend `ReusedConnectTestCase`, which skips when 
Connect deps are absent,
   so no test coverage is lost.
   
   ### Why are the changes needed?
   
   The scheduled "Python-only (Python 3.14, no GIL)" build runs on the 
free-threaded interpreter
   `python3.14t`, whose image intentionally omits `grpcio` (no free-threaded 
wheels yet; see
   `dev/spark-test-image/python-314-nogil/Dockerfile`). These two test modules 
imported
   `pyspark.sql.connect.context` at module top level, so collection failed with
   `ModuleNotFoundError: No module named 'grpc'` -> `PySparkImportError 
[PACKAGE_NOT_INSTALLED] grpcio`,
   aborting the build (exit 19) before tests ran.
   
   ### Does this PR introduce any user-facing change?
   
   No. Test-only change.
   
   ### How was this patch tested?
   
   Validated on fork CI (green):
   - Python 3.14 no-GIL: 
https://github.com/HyukjinKwon/spark/actions/runs/27928957160 (all PySpark 
module jobs green, incl. pyspark-connect)
   - Python Classic-only (3.12): validation in progress at 
https://github.com/HyukjinKwon/spark/actions/runs/27928957158 (will update when 
green; this fix is a no-op on classic and only affects grpc-less import 
behavior)
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Yes. Generated with Claude Code (Anthropic).
   
   ---
   NOTE FOR COMMITTER: the final `[DO NOT MERGE] CI: trigger ...` commit is 
validation-only and must be
   dropped before merging. JIRA id TBD; please assign a SPARK ticket and adjust 
the component tag.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to