You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ru...@apache.org on 2025/06/03 08:32:28 UTC
(spark) branch master updated: [SPARK-52238][TESTS][FOLLOW-UP] Fix test failure in daily builds
This is an automated email from the ASF dual-hosted git repository.
ruifengz 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 80657974ee69 [SPARK-52238][TESTS][FOLLOW-UP] Fix test failure in daily builds
80657974ee69 is described below
commit 80657974ee691a36c5a761629260a65b2fb7fa03
Author: Ruifeng Zheng <ru...@apache.org>
AuthorDate: Tue Jun 3 16:32:10 2025 +0800
[SPARK-52238][TESTS][FOLLOW-UP] Fix test failure in daily builds
### What changes were proposed in this pull request?
python 3.12/3.13 were broken:
```
======================================================================
ERROR [0.019s]: test_collect_blocked (__main__.BlockSparkConnectAccessTests.test_collect_blocked)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/__w/spark/spark/python/pyspark/pipelines/tests/test_block_connect_access.py", line 51, in test_collect_blocked
self.assertEquals(
^^^^^^^^^^^^^^^^^
AttributeError: 'BlockSparkConnectAccessTests' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?
======================================================================
ERROR [0.016s]: test_schema_access_blocked (__main__.BlockSparkConnectAccessTests.test_schema_access_blocked)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/__w/spark/spark/python/pyspark/pipelines/tests/test_block_connect_access.py", line 41, in test_schema_access_blocked
self.assertEquals(
^^^^^^^^^^^^^^^^^
AttributeError: 'BlockSparkConnectAccessTests' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?
----------------------------------------------------------------------
Ran 5 tests in 7.175s
```
### Why are the changes needed?
to make CI happy
### Does this PR introduce _any_ user-facing change?
no, test-only
### How was this patch tested?
PR build with
```
default: '{"PYSPARK_IMAGE_TO_TEST": "python-312", "PYTHON_TO_TEST": "python3.12"}'
```
https://github.com/zhengruifeng/spark/actions/runs/15407621295/job/43353257681
### Was this patch authored or co-authored using generative AI tooling?
no
Closes #51067 from zhengruifeng/fix_assert_equals.
Authored-by: Ruifeng Zheng <ru...@apache.org>
Signed-off-by: Ruifeng Zheng <ru...@apache.org>
---
.../pipelines/tests/test_block_connect_access.py | 4 +--
python/pyspark/pipelines/tests/test_decorators.py | 4 +--
.../pipelines/tests/test_graph_element_registry.py | 36 +++++++++++-----------
3 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/python/pyspark/pipelines/tests/test_block_connect_access.py b/python/pyspark/pipelines/tests/test_block_connect_access.py
index ee71681f47b2..5467dded430c 100644
--- a/python/pyspark/pipelines/tests/test_block_connect_access.py
+++ b/python/pyspark/pipelines/tests/test_block_connect_access.py
@@ -38,7 +38,7 @@ class BlockSparkConnectAccessTests(ReusedConnectTestCase):
with block_spark_connect_execution_and_analysis():
with self.assertRaises(PySparkException) as context:
df.schema
- self.assertEquals(
+ self.assertEqual(
context.exception.getCondition(), "ATTEMPT_ANALYSIS_IN_PIPELINE_QUERY_FUNCTION"
)
@@ -48,7 +48,7 @@ class BlockSparkConnectAccessTests(ReusedConnectTestCase):
with block_spark_connect_execution_and_analysis():
with self.assertRaises(PySparkException) as context:
df.collect()
- self.assertEquals(
+ self.assertEqual(
context.exception.getCondition(), "ATTEMPT_ANALYSIS_IN_PIPELINE_QUERY_FUNCTION"
)
diff --git a/python/pyspark/pipelines/tests/test_decorators.py b/python/pyspark/pipelines/tests/test_decorators.py
index 0b3d12e61b0e..ac575b43d109 100644
--- a/python/pyspark/pipelines/tests/test_decorators.py
+++ b/python/pyspark/pipelines/tests/test_decorators.py
@@ -55,10 +55,10 @@ class DecoratorsTest(unittest.TestCase):
with self.assertRaises(PySparkTypeError) as context:
decorator("table1")
- self.assertEquals(context.exception.getCondition(), "DECORATOR_ARGUMENT_NOT_CALLABLE")
+ self.assertEqual(context.exception.getCondition(), "DECORATOR_ARGUMENT_NOT_CALLABLE")
message_parameters = context.exception.getMessageParameters()
assert message_parameters is not None
- self.assertEquals(message_parameters["decorator_name"], decorator.__name__)
+ self.assertEqual(message_parameters["decorator_name"], decorator.__name__)
assert message_parameters["example_usage"].startswith(f"@{decorator.__name__}(")
diff --git a/python/pyspark/pipelines/tests/test_graph_element_registry.py b/python/pyspark/pipelines/tests/test_graph_element_registry.py
index c8e6bfc9ceb1..9ebf29d1ed47 100644
--- a/python/pyspark/pipelines/tests/test_graph_element_registry.py
+++ b/python/pyspark/pipelines/tests/test_graph_element_registry.py
@@ -46,41 +46,41 @@ class GraphElementRegistryTest(unittest.TestCase):
def flow2():
raise NotImplementedError()
- self.assertEquals(len(registry.datasets), 3)
- self.assertEquals(len(registry.flows), 4)
+ self.assertEqual(len(registry.datasets), 3)
+ self.assertEqual(len(registry.flows), 4)
mv_obj = registry.datasets[0]
- self.assertEquals(mv_obj.name, "mv")
+ self.assertEqual(mv_obj.name, "mv")
assert mv_obj.source_code_location.filename.endswith("test_graph_element_registry.py")
mv_flow_obj = registry.flows[0]
- self.assertEquals(mv_flow_obj.name, "mv")
- self.assertEquals(mv_flow_obj.target, "mv")
+ self.assertEqual(mv_flow_obj.name, "mv")
+ self.assertEqual(mv_flow_obj.target, "mv")
assert mv_flow_obj.source_code_location.filename.endswith("test_graph_element_registry.py")
st_obj = registry.datasets[1]
- self.assertEquals(st_obj.name, "st")
+ self.assertEqual(st_obj.name, "st")
assert st_obj.source_code_location.filename.endswith("test_graph_element_registry.py")
st_flow_obj = registry.flows[1]
- self.assertEquals(st_flow_obj.name, "st")
- self.assertEquals(st_flow_obj.target, "st")
+ self.assertEqual(st_flow_obj.name, "st")
+ self.assertEqual(st_flow_obj.target, "st")
assert mv_flow_obj.source_code_location.filename.endswith("test_graph_element_registry.py")
st2_obj = registry.datasets[2]
- self.assertEquals(st2_obj.name, "st2")
+ self.assertEqual(st2_obj.name, "st2")
assert st2_obj.source_code_location.filename.endswith("test_graph_element_registry.py")
st2_flow1_obj = registry.flows[2]
- self.assertEquals(st2_flow1_obj.name, "flow1")
- self.assertEquals(st2_flow1_obj.target, "st2")
- self.assertEquals(st2_flow1_obj.once, True)
+ self.assertEqual(st2_flow1_obj.name, "flow1")
+ self.assertEqual(st2_flow1_obj.target, "st2")
+ self.assertEqual(st2_flow1_obj.once, True)
assert mv_flow_obj.source_code_location.filename.endswith("test_graph_element_registry.py")
st2_flow1_obj = registry.flows[3]
- self.assertEquals(st2_flow1_obj.name, "flow2")
- self.assertEquals(st2_flow1_obj.target, "st2")
- self.assertEquals(st2_flow1_obj.once, False)
+ self.assertEqual(st2_flow1_obj.name, "flow2")
+ self.assertEqual(st2_flow1_obj.target, "st2")
+ self.assertEqual(st2_flow1_obj.once, False)
assert mv_flow_obj.source_code_location.filename.endswith("test_graph_element_registry.py")
def test_definition_without_graph_element_registry(self):
@@ -91,7 +91,7 @@ class GraphElementRegistryTest(unittest.TestCase):
def a():
raise NotImplementedError()
- self.assertEquals(
+ self.assertEqual(
context.exception.getCondition(),
"GRAPH_ELEMENT_DEFINED_OUTSIDE_OF_DECLARATIVE_PIPELINE",
)
@@ -99,7 +99,7 @@ class GraphElementRegistryTest(unittest.TestCase):
with self.assertRaises(PySparkException) as context:
sdp.create_streaming_table("st")
- self.assertEquals(
+ self.assertEqual(
context.exception.getCondition(),
"GRAPH_ELEMENT_DEFINED_OUTSIDE_OF_DECLARATIVE_PIPELINE",
)
@@ -110,7 +110,7 @@ class GraphElementRegistryTest(unittest.TestCase):
def b():
raise NotImplementedError()
- self.assertEquals(
+ self.assertEqual(
context.exception.getCondition(),
"GRAPH_ELEMENT_DEFINED_OUTSIDE_OF_DECLARATIVE_PIPELINE",
)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org