[jira] [Updated] (SPARK-46820) Fix error message regression by restoring new_msg

2024-01-23 Thread Haejoon Lee (Jira)


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

Haejoon Lee updated SPARK-46820:

Description: 
>>> from pyspark.sql.types import StructType, StructField, StringType, 
>>> IntegerType
>>> schema = StructType([
...     StructField("name", StringType(), nullable=True),
...     StructField("age", IntegerType(), nullable=False)
... ])
>>> df = spark.createDataFrame([("asd", None])], schema)
pyspark.errors.exceptions.base.PySparkValueError: [CANNOT_BE_NONE] Argument 
`obj` cannot be None.

 

  was:
>>> from pyspark.sql.types import StructType, StructField, StringType, 
>>> IntegerType
>>> schema = StructType([
...     StructField("name", StringType(), nullable=True),
...     StructField("age", IntegerType(), nullable=False)
... ])
>>> df = spark.createDataFrame([("asd", None])], schema)
pyspark.errors.exceptions.base.PySparkValueError: [CANNOT_BE_NONE] Argument 
`obj` cannot be None.

 

The error message in the example above says "obj", but createDataFrame function 
has not "obj" reference. We should fix this error message properly.


> Fix error message regression by restoring new_msg
> -
>
> Key: SPARK-46820
> URL: https://issues.apache.org/jira/browse/SPARK-46820
> Project: Spark
>  Issue Type: Sub-task
>  Components: PySpark
>Affects Versions: 4.0.0
>Reporter: Haejoon Lee
>Priority: Major
>  Labels: pull-request-available
>
> >>> from pyspark.sql.types import StructType, StructField, StringType, 
> >>> IntegerType
> >>> schema = StructType([
> ...     StructField("name", StringType(), nullable=True),
> ...     StructField("age", IntegerType(), nullable=False)
> ... ])
> >>> df = spark.createDataFrame([("asd", None])], schema)
> pyspark.errors.exceptions.base.PySparkValueError: [CANNOT_BE_NONE] Argument 
> `obj` cannot be None.
>  



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

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



[jira] [Updated] (SPARK-46820) Fix error message regression by restoring new_msg

2024-01-23 Thread Haejoon Lee (Jira)


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

Haejoon Lee updated SPARK-46820:

Summary: Fix error message regression by restoring new_msg  (was: Improve 
error message when createDataFrame have illegal nullable)

> Fix error message regression by restoring new_msg
> -
>
> Key: SPARK-46820
> URL: https://issues.apache.org/jira/browse/SPARK-46820
> Project: Spark
>  Issue Type: Sub-task
>  Components: PySpark
>Affects Versions: 4.0.0
>Reporter: Haejoon Lee
>Priority: Major
>  Labels: pull-request-available
>
> >>> from pyspark.sql.types import StructType, StructField, StringType, 
> >>> IntegerType
> >>> schema = StructType([
> ...     StructField("name", StringType(), nullable=True),
> ...     StructField("age", IntegerType(), nullable=False)
> ... ])
> >>> df = spark.createDataFrame([("asd", None])], schema)
> pyspark.errors.exceptions.base.PySparkValueError: [CANNOT_BE_NONE] Argument 
> `obj` cannot be None.
>  
> The error message in the example above says "obj", but createDataFrame 
> function has not "obj" reference. We should fix this error message properly.



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

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