HyukjinKwon commented on a change in pull request #33214:
URL: https://github.com/apache/spark/pull/33214#discussion_r664341267



##########
File path: python/pyspark/sql/tests/test_types.py
##########
@@ -204,6 +204,16 @@ def test_infer_nested_schema(self):
         df = self.spark.createDataFrame(rdd)
         self.assertEqual(Row(field1=1, field2=u'row1'), df.first())
 
+    def test_infer_nested_dict(self):
+        # SPARK-35929: Test inferring nested dict as a struct type.
+        NestedRow = Row("f1", "f2")
+
+        with 
self.sql_conf({"spark.sql.pyspark.inferNestedDictAsStruct.enabled": True}):
+            nestedRdd = self.sc.parallelize([NestedRow([{"payment": 200.5, 
"name": "A"}], [1, 2]),

Review comment:
       Can we also test with local dataset instead of RDD? e.g., 
`spark.createDataFrame([NestedRow([{"payment": 200.5, "name": ", ...)` because 
the code path is different.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to