Github user holdenk commented on a diff in the pull request:
https://github.com/apache/spark/pull/16793#discussion_r103089704
--- Diff: python/pyspark/sql/tests.py ---
@@ -1591,6 +1591,67 @@ def test_replace(self):
self.assertEqual(row.age, 10)
self.assertEqual(row.height, None)
+ # replace with lists
+ row = self.spark.createDataFrame(
+ [(u'Alice', 10, 80.1)], schema).replace([u'Alice'],
[u'Ann']).first()
+ self.assertTupleEqual(row, (u'Ann', 10, 80.1))
+
+ # replace with dict
+ row = self.spark.createDataFrame(
+ [(u'Alice', 10, 80.1)], schema).replace({10: 11}).first()
+ self.assertTupleEqual(row, (u'Alice', 11, 80.1))
--- End diff --
I think (and I could be wrong) that @nchammas was suggesting it might make
sense to have some more tests with dict, not that the other additional new
tests are bad.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]