allisonwang-db commented on code in PR #47835:
URL: https://github.com/apache/spark/pull/47835#discussion_r1731803830
##########
python/pyspark/sql/dataframe.py:
##########
@@ -4595,6 +4597,8 @@ def dropDuplicates(self, *subset: Union[str, List[str]])
-> "DataFrame":
subset : list of column names, optional
List of columns to use for duplicate comparison (default All
columns).
+ subset_varargs : optional arguments used for supporting
variable-length argument.
Review Comment:
nit: let's also add supported version for this parameter
##########
python/pyspark/sql/dataframe.py:
##########
@@ -4627,11 +4631,22 @@ def dropDuplicates(self, *subset: Union[str,
List[str]]) -> "DataFrame":
+-----+---+------+
|Alice| 5| 80|
+-----+---+------+
+
+ Deduplicate values on 'name' and 'height' columns.
+
+ >>> df.dropDuplicates(subset=['name', 'height']).show()
+ +-----+---+------+
+ | name|age|height|
+ +-----+---+------+
+ |Alice| 5| 80|
+ +-----+---+------+
Review Comment:
Hmm this example is exactly the same as the above one. It can be confusing
to users whether they should use `dropDuplicates(subset=['name', 'height'])` or
directly use `dropDuplicates('name', 'height')`
##########
python/pyspark/sql/dataframe.py:
##########
@@ -4681,6 +4698,10 @@ def dropDuplicatesWithinWatermark(self, *subset:
Union[str, List[str]]) -> "Data
Deduplicate values on 'value' columns.
>>> df.dropDuplicatesWithinWatermark('value') # doctest: +SKIP
+
+ Deduplicate values on 'value' columns.
+
+ >>> df.dropDuplicatesWithinWatermark(subset=['value']) # doctest:
+SKIP
Review Comment:
ditto
--
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]