itholic commented on code in PR #39785:
URL: https://github.com/apache/spark/pull/39785#discussion_r1090540640


##########
python/pyspark/sql/dataframe.py:
##########
@@ -3795,8 +3868,11 @@ def dropDuplicates(self, subset: Optional[List[str]] = 
None) -> "DataFrame":
         |Alice|  5|    80|
         +-----+---+------+
         """
-        if subset is not None and (not isinstance(subset, Iterable) or 
isinstance(subset, str)):
-            raise TypeError("Parameter 'subset' must be a list of columns")
+        if subset is not None and not isinstance(subset, (list, tuple)):

Review Comment:
   The previous behavior only allows `Iterable` (the intention of this is to 
allow `list` and `tuple` type) for `subset`, but disallows the `str`, because 
`str` in Python is also treated as an `Iterable` since `str` subclass of 
`Iterable`.
   
   And that is not so clear to understand, so I refine this condition more 
clearly here.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to