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` (and `tuple` is one of
`Iterable`) for `subset`, and sort-out `str` separately to disallow it because
`str` in Python is also treated as an `Iterable`.
And I think that was not very 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]