itholic commented on code in PR #37761:
URL: https://github.com/apache/spark/pull/37761#discussion_r969063318
##########
python/pyspark/sql/tests/test_dataframe.py:
##########
@@ -96,6 +96,22 @@ def test_drop(self):
self.assertEqual(df.drop(col("name"), col("age")).columns, ["active"])
self.assertEqual(df.drop(col("name"), col("age"),
col("random")).columns, ["active"])
+ def test_with_columns_renamed(self):
+ df = self.spark.createDataFrame([("Alice", 50), ("Alice", 60)],
["name", "age"])
+
+ # rename both columns
+ renamed_df1 = df.withColumnsRenamed({"name": "naam", "age":
"leeftijd"})
+ self.assertEqual(renamed_df1.columns, ["naam", "leeftijd"])
+
+ # rename one columns with one missing name
Review Comment:
nit: "rename one columns" -> "rename one column"
--
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]