This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 8585c514cd93 [SPARK-55607][PYTHON][TESTS] Skip test_session if we
should not test connect
8585c514cd93 is described below
commit 8585c514cd937201453bb00d8945937637342031
Author: Tian Gao <[email protected]>
AuthorDate: Fri Feb 20 09:16:09 2026 +0900
[SPARK-55607][PYTHON][TESTS] Skip test_session if we should not test connect
### What changes were proposed in this pull request?
Skip `test_session` if we should not test connect.
### Why are the changes needed?
All connect tests should be protected. classic only CI is failing -
https://github.com/apache/spark/actions/runs/22163293785/job/64085212969
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
CI.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #54383 from gaogaotiantian/protect-test-session.
Authored-by: Tian Gao <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
---
python/pyspark/sql/tests/connect/test_session.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/python/pyspark/sql/tests/connect/test_session.py
b/python/pyspark/sql/tests/connect/test_session.py
index e327c868895f..0c64b558be5f 100644
--- a/python/pyspark/sql/tests/connect/test_session.py
+++ b/python/pyspark/sql/tests/connect/test_session.py
@@ -18,8 +18,14 @@
import unittest
from typing import Optional
-from pyspark.sql.connect.client import DefaultChannelBuilder
-from pyspark.sql.connect.session import SparkSession as RemoteSparkSession
+from pyspark.testing.connectutils import (
+ should_test_connect,
+ connect_requirement_message,
+)
+
+if should_test_connect:
+ from pyspark.sql.connect.client import DefaultChannelBuilder
+ from pyspark.sql.connect.session import SparkSession as RemoteSparkSession
class CustomChannelBuilder(DefaultChannelBuilder):
@@ -28,6 +34,7 @@ class CustomChannelBuilder(DefaultChannelBuilder):
return "abc"
[email protected](not should_test_connect, connect_requirement_message)
class SparkSessionTestCase(unittest.TestCase):
def test_fails_to_create_session_without_remote_and_channel_builder(self):
with self.assertRaises(ValueError):
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]