Skip to content

Commit 8222670

Browse files
committed
[SPARK-52470][TESTS][FOLLOWUP] Fix test failure caused by import connect in pure classic testing envs
### What changes were proposed in this pull request? Fix test failure caused by import connect in pure classic testing envs ### Why are the changes needed? to fix failures in scheduled jobs like https://github.com/apache/spark/actions/runs/15746558966/job/44384032554 ### Does this PR introduce _any_ user-facing change? no, test-only ### How was this patch tested? will monitor the scheduled jobs ### Was this patch authored or co-authored using generative AI tooling? no Closes #51220 from zhengruifeng/test_grpc. Authored-by: Ruifeng Zheng <[email protected]> Signed-off-by: Ruifeng Zheng <[email protected]>
1 parent 44d9fce commit 8222670

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/pyspark/ml/util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
from contextlib import contextmanager
4141

4242
from pyspark import since
43-
from pyspark.errors.exceptions.connect import SparkException
4443
from pyspark.ml.common import inherit_doc
4544
from pyspark.sql import SparkSession
4645
from pyspark.sql.utils import is_remote
@@ -319,6 +318,8 @@ def remote_call() -> Any:
319318
return deserialize(properties)
320319

321320
if is_remote() and "PYSPARK_NO_NAMESPACE_SHARE" not in os.environ:
321+
from pyspark.errors.exceptions.connect import SparkException
322+
322323
try:
323324
return remote_call()
324325
except SparkException as e:

0 commit comments

Comments
 (0)