You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2023/01/06 02:48:00 UTC

[jira] [Assigned] (SPARK-41869) DataFrame dropDuplicates should throw error on non list argument

     [ https://issues.apache.org/jira/browse/SPARK-41869?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Apache Spark reassigned SPARK-41869:
------------------------------------

    Assignee:     (was: Apache Spark)

> DataFrame dropDuplicates should throw error on non list argument
> ----------------------------------------------------------------
>
>                 Key: SPARK-41869
>                 URL: https://issues.apache.org/jira/browse/SPARK-41869
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Connect
>    Affects Versions: 3.4.0
>            Reporter: Sandeep Singh
>            Priority: Major
>
> {code:java}
> df = self.spark.createDataFrame([("Alice", 50), ("Alice", 60)], ["name", "age"])
> # shouldn't drop a non-null row
> self.assertEqual(df.dropDuplicates().count(), 2)
> self.assertEqual(df.dropDuplicates(["name"]).count(), 1)
> self.assertEqual(df.dropDuplicates(["name", "age"]).count(), 2)
> type_error_msg = "Parameter 'subset' must be a list of columns"
> with self.assertRaisesRegex(TypeError, type_error_msg):
>     df.dropDuplicates("name"){code}
> {code:java}
> Traceback (most recent call last):
>   File "/Users/s.singh/personal/spark-oss/python/pyspark/sql/tests/test_dataframe.py", line 128, in test_drop_duplicates
>     with self.assertRaisesRegex(TypeError, type_error_msg):
> AssertionError: TypeError not raised{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org