Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20499#discussion_r166217503
  
    --- Diff: python/pyspark/sql/dataframe.py ---
    @@ -1587,6 +1597,51 @@ def replace(self, to_replace, value=None, 
subset=None):
             |null|  null|null|
             +----+------+----+
             """
    +
    +        # It deals with a problem when 'value' is set to None and 
'to_replace' is a dictionary.
    +        # Validate if arguments are missing or not.
    +        is_more_than_two = len(args) + len(kwargs) > 2
    --- End diff --
    
    I read this few times and still feel that this is kind of verbose. But 
seems there is no better way to check if an optional parameter is set or not in 
Python.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to