Github user zero323 commented on a diff in the pull request:
https://github.com/apache/spark/pull/16793#discussion_r100704329
--- 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 --
These tests are mostly a side effect of discussions related to
https://github.com/apache/spark/pull/16792 Right now test coverage is low and
we depend on a certain behavior of Py4j and Scala counterpart. Also I wanted to
be sure that all the expected types are still accepted after the changes I've
made.
---
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]