Commit bdc850f
[SPARK-54745][PYTHON] Fix PySpark import error caused by missing UnixStreamServer on Windows
### What changes were proposed in this pull request?
This PR fixes an error caused by `socketserver.UnixStreamServer` not being available on Windows. We define a fallback `AccumulatorUnixServer` to raise an exception on construction and inform the user to disable `spark.python.unix.domain.socket.enabled`.
### Why are the changes needed?
`import pyspark` fails with the following message on Windows since PySpark 4.1.0:
```
sedona\spark\__init__.py:19: in <module>
import pyspark
.venv\Lib\site-packages\pyspark\__init__.py:71: in <module>
from pyspark.accumulators import Accumulator, AccumulatorParam
.venv\Lib\site-packages\pyspark\accumulators.py:324: in <module>
class AccumulatorUnixServer(socketserver.UnixStreamServer):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E AttributeError: module 'socketserver' has no attribute 'UnixStreamServer'
```
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Manually test this on Windows 11
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #53546 from Kontinuation/fix-uds-windows-compat.
Authored-by: Kristin Cowalcijk <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
(cherry picked from commit a8f817d)
Signed-off-by: Hyukjin Kwon <[email protected]>1 parent 89cdd63 commit bdc850f
1 file changed
+30
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
339 | 354 | | |
340 | 355 | | |
341 | 356 | | |
| |||
0 commit comments