diff --git a/python/pyspark/sql/connect/functions/builtin.py b/python/pyspark/sql/connect/functions/builtin.py index 407f871a37059..2d15c70efeb28 100644 --- a/python/pyspark/sql/connect/functions/builtin.py +++ b/python/pyspark/sql/connect/functions/builtin.py @@ -2035,6 +2035,7 @@ def parse_json(col: "ColumnOrName") -> Column: parse_json.__doc__ = pysparkfuncs.parse_json.__doc__ + def posexplode(col: "ColumnOrName") -> Column: return _invoke_function_over_columns("posexplode", col) diff --git a/python/pyspark/sql/tests/test_functions.py b/python/pyspark/sql/tests/test_functions.py index 09fb1cae8deea..23f7f9e00216c 100644 --- a/python/pyspark/sql/tests/test_functions.py +++ b/python/pyspark/sql/tests/test_functions.py @@ -1306,14 +1306,14 @@ def test_map_functions(self): self.assertEqual(expected, actual["from_items"]) def test_parse_json(self): - df = self.spark.createDataFrame([ {'json': '''{ "a" : 1 }'''} ]) + df = self.spark.createDataFrame([{"json": """{ "a" : 1 }"""}]) actual = df.select( F.to_json(F.parse_json(df.json)).alias("var"), - F.to_json(F.parse_json(F.lit('''{"b": [{"c": "str2"}]}'''))).alias("var_lit"), + F.to_json(F.parse_json(F.lit("""{"b": [{"c": "str2"}]}"""))).alias("var_lit"), ).first() - self.assertEqual('''{"a":1}''', actual["var"]) - self.assertEqual('''{"b":[{"c":"str2"}]}''', actual["var_lit"]) + self.assertEqual("""{"a":1}""", actual["var"]) + self.assertEqual("""{"b":[{"c":"str2"}]}""", actual["var_lit"]) def test_schema_of_json(self): with self.assertRaises(PySparkTypeError) as pe: