You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/07/15 11:03:32 UTC

[GitHub] [spark] dominikgehl commented on a change in pull request #33364: Add type check on dropDuplicates pyspark function

dominikgehl commented on a change in pull request #33364:
URL: https://github.com/apache/spark/pull/33364#discussion_r670360756



##########
File path: python/pyspark/sql/dataframe.py
##########
@@ -1982,6 +1982,8 @@ def dropDuplicates(self, subset=None):
         """
         if subset is None:
             jdf = self._jdf.dropDuplicates()
+        elif not isinstance(subset, list):
+            raise TypeError("Parameter 'subset' must be a list of columns")

Review comment:
       wouldn't it be better to use something like what we have in dropna ?
   i.e.
   `
           elif isinstance(subset, str):
               subset = [subset]
           elif not isinstance(subset, (list, tuple)):
               raise TypeError("subset should be a list or tuple of column names")
   `




-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org