Github user viirya commented on a diff in the pull request:
    --- Diff: python/pyspark/sql/ ---
    @@ -1964,6 +1964,16 @@ def test_replace(self):
                    .replace(False, True).first())
             self.assertTupleEqual(row, (True, True))
    +        # replace with None
    +        row = self.spark.createDataFrame(
    +            [(u'Alice', 10, 80.0)], schema).replace(u'Alice', None).first()
    +        self.assertTupleEqual(row, (None, 10, 80.0))
    +        # replace with numerics and None
    +        row = self.spark.createDataFrame(
    +            [(u'Alice', 10, 80.0)], schema).replace([10, 80], [20, 
    +        self.assertTupleEqual(row, (u'Alice', 20, None))
    --- End diff --
    Can you add a test that `to_replace` is a list and `value` is not given (so 
as default value `None`)? Previously this will arise a `ValueError`. But now it 
is a valid usage. We are better to add a test explicitly for it.

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 or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to