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 2021/04/26 08:22:00 UTC

[jira] [Assigned] (SPARK-35176) Raise TypeError in inappropriate type case rather than ValueError

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

Apache Spark reassigned SPARK-35176:
------------------------------------

    Assignee: Apache Spark

>  Raise TypeError in inappropriate type case rather than ValueError
> ------------------------------------------------------------------
>
>                 Key: SPARK-35176
>                 URL: https://issues.apache.org/jira/browse/SPARK-35176
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 3.2.0
>            Reporter: Yikun Jiang
>            Assignee: Apache Spark
>            Priority: Minor
>
> There are many wrong error type usages on ValueError type.
> When an operation or function is applied to an object of inappropriate type, we should use TypeError rather than ValueError.
> such as:
> [https://github.com/apache/spark/blob/355c39939d9e4c87ffc9538eb822a41cb2ff93fb/python/pyspark/sql/dataframe.py#L1137]
> [https://github.com/apache/spark/blob/355c39939d9e4c87ffc9538eb822a41cb2ff93fb/python/pyspark/sql/dataframe.py#L1228]
>  
> We should do some correction in some right time, note that if we do these corrections, it will break some catch on original ValueError.
>  
> [1] https://docs.python.org/3/library/exceptions.html#TypeError



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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