Skip to content

Commit eec9f8f

Browse files
committed
[SPARK-54820][PYTHON][4.0][4.1] Make pandas_on_spark_type compatible with numpy 2.4.0
backport #53580 to 4.0 and 4.1, to restore https://github.com/apache/spark/actions/runs/20493084511/job/58888601618 Closes #53604 from zhengruifeng/bp_np_24. Authored-by: Ruifeng Zheng <[email protected]> Signed-off-by: Ruifeng Zheng <[email protected]>
1 parent 51042d6 commit eec9f8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/pyspark/pandas/typedef/typehints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def pandas_on_spark_type(tpe: Union[str, type, Dtype]) -> Tuple[Dtype, types.Dat
342342
try:
343343
dtype = pandas_dtype(tpe)
344344
spark_type = as_spark_type(dtype)
345-
except TypeError:
345+
except (TypeError, ValueError):
346346
spark_type = as_spark_type(tpe)
347347
dtype = spark_type_to_pandas_dtype(spark_type)
348348
return dtype, spark_type

0 commit comments

Comments
 (0)