Skip to content

Commit bf0d3c5

Browse files
techaddictHyukjinKwon
authored andcommitted
[SPARK-42073][CONNECT][PYTHON][TESTS] Enable tests in common/test_parity_serde, common/test_parity_types
### What changes were proposed in this pull request? Enable tests in common/test_parity_serde, common/test_parity_types ### Why are the changes needed? for test coverage ### Does this PR introduce _any_ user-facing change? no, test-only ### How was this patch tested? enabled UT Closes #39583 from techaddict/SPARK-42073. Authored-by: Sandeep Singh <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
1 parent 98de7eb commit bf0d3c5

File tree

4 files changed

+3
-16
lines changed

4 files changed

+3
-16
lines changed

python/pyspark/sql/tests/connect/test_parity_serde.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ def test_int_array_serialization(self):
3030
def test_serialize_nested_array_and_map(self):
3131
super().test_serialize_nested_array_and_map()
3232

33-
@unittest.skip("Spark Connect does not support RDD but the tests depend on them.")
34-
def test_struct_in_map(self):
35-
super().test_struct_in_map()
36-
3733

3834
if __name__ == "__main__":
3935
import unittest

python/pyspark/sql/tests/connect/test_parity_types.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ def test_cast_to_udt_with_udt(self):
5959
def test_complex_nested_udt_in_df(self):
6060
super().test_complex_nested_udt_in_df()
6161

62-
@unittest.skip("Spark Connect does not support RDD but the tests depend on them.")
63-
def test_convert_row_to_dict(self):
64-
super().test_convert_row_to_dict()
65-
6662
# TODO(SPARK-42020): createDataFrame with UDT
6763
@unittest.skip("Fails in Spark Connect, should enable.")
6864
def test_create_dataframe_from_objects(self):
@@ -137,10 +133,6 @@ def test_infer_schema_upcast_int_to_string(self):
137133
def test_infer_schema_with_udt(self):
138134
super().test_infer_schema_with_udt()
139135

140-
@unittest.skip("Spark Connect does not support RDD but the tests depend on them.")
141-
def test_metadata_null(self):
142-
super().test_metadata_null()
143-
144136
# TODO(SPARK-41834): Implement SparkSession.conf
145137
@unittest.skip("Fails in Spark Connect, should enable.")
146138
def test_negative_decimal(self):

python/pyspark/sql/tests/test_serde.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_select_null_literal(self):
5454

5555
def test_struct_in_map(self):
5656
d = [Row(m={Row(i=1): Row(s="")})]
57-
df = self.sc.parallelize(d).toDF()
57+
df = self.spark.createDataFrame(d)
5858
k, v = list(df.head().m.items())[0]
5959
self.assertEqual(1, k.i)
6060
self.assertEqual("", v.s)

python/pyspark/sql/tests/test_types.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ def test_apply_schema(self):
480480
def test_convert_row_to_dict(self):
481481
row = Row(l=[Row(a=1, b="s")], d={"key": Row(c=1.0, d="2")})
482482
self.assertEqual(1, row.asDict()["l"][0].a)
483-
df = self.sc.parallelize([row]).toDF()
483+
df = self.spark.createDataFrame([row])
484484

485485
with self.tempView("test"):
486486
df.createOrReplaceTempView("test")
@@ -788,8 +788,7 @@ def test_metadata_null(self):
788788
StructField("f2", StringType(), True, {"a": None}),
789789
]
790790
)
791-
rdd = self.sc.parallelize([["a", "b"], ["c", "d"]])
792-
self.spark.createDataFrame(rdd, schema)
791+
self.spark.createDataFrame([["a", "b"], ["c", "d"]], schema)
793792

794793
def test_access_nested_types(self):
795794
df = self.spark.createDataFrame([Row(l=[1], r=Row(a=1, b="b"), d={"k": "v"})])

0 commit comments

Comments
 (0)