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 2022/10/24 02:38:54 UTC
[GitHub] [spark] HyukjinKwon commented on a diff in pull request #38327: [SPARK-40812][CONNECT][PYTHON][FOLLOW-UP] Improve Deduplicate in Python client
HyukjinKwon commented on code in PR #38327:
URL: https://github.com/apache/spark/pull/38327#discussion_r1002841262
##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -157,11 +157,44 @@ def coalesce(self, num_partitions: int) -> "DataFrame":
def describe(self, cols: List[ColumnRef]) -> Any:
...
+ def dropDuplicates(self, subset: Optional[List[str]] = None) -> "DataFrame":
+ """Return a new :class:`DataFrame` with duplicate rows removed,
+ optionally only deduplicating based on certain columns.
+
+ .. versionadded:: 3.4.0
+
+ Parameters
+ ----------
+ subset : List of column names, optional
+ List of columns to use for duplicate comparison (default All columns).
+
+ Returns
+ -------
+ :class:`DataFrame`
+ DataFrame without duplicated rows.
+ """
+ if subset is None:
+ return DataFrame.withPlan(
+ plan.Deduplicate(child=self._plan, all_columns_as_keys=True), session=self._session
Review Comment:
cc @cloud-fan
--
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