WweiL commented on code in PR #47835:
URL: https://github.com/apache/spark/pull/47835#discussion_r1727564734


##########
python/pyspark/sql/classic/dataframe.py:
##########
@@ -1222,46 +1222,76 @@ def intersectAll(self, other: ParentDataFrame) -> 
ParentDataFrame:
     def subtract(self, other: ParentDataFrame) -> ParentDataFrame:
         return DataFrame(getattr(self._jdf, "except")(other._jdf), 
self.sparkSession)
 
-    def dropDuplicates(self, *subset: Union[str, List[str]]) -> 
ParentDataFrame:
-        # Acceptable args should be str, ... or a single List[str]
-        # So if subset length is 1, it can be either single str, or a list of 
str
-        # if subset length is greater than 1, it must be a sequence of str
-        if not subset:
+    def dropDuplicates(
+        self, subset: Optional[Union[str, List[str], _NoValueType]] = 
_NoValue, *subset_varargs: str
+    ) -> ParentDataFrame:
+        # No parameter passed in (e.g. dropDuplicates())
+        if subset is _NoValue:
             jdf = self._jdf.dropDuplicates()
-        elif len(subset) == 1 and isinstance(subset[0], list):
-            item = subset[0]
+        # Parameters passed in as varargs
+        # (e.g. dropDuplicates("col"), dropDuplicates("col1", "col2"), ...)
+        elif isinstance(subset, str):
+            item = [subset] + list(subset_varargs)

Review Comment:
   ah sure let me add them



-- 
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