You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Haotian Sun (Jira)" <ji...@apache.org> on 2026/08/11 20:51:00 UTC
[jira] [Updated] (SPARK-58718) Fix signbit for -0.0 and nullable dtypes
[ https://issues.apache.org/jira/browse/SPARK-58718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Haotian Sun updated SPARK-58718:
--------------------------------
Affects Version/s: 4.4.0
(was: 5.0.0)
> Fix signbit for -0.0 and nullable dtypes
> ----------------------------------------
>
> Key: SPARK-58718
> URL: https://issues.apache.org/jira/browse/SPARK-58718
> Project: Spark
> Issue Type: Sub-task
> Components: Pandas API on Spark
> Affects Versions: 4.4.0
> Reporter: Haotian Sun
> Priority: Major
>
> np.signbit in the pandas API on Spark maps to F.when(c < 0, True).otherwise(False), which returns the wrong result for -0.0: np.signbit(-0.0) is True because the IEEE-754 sign bit is set, but -0.0 < 0 is False, so the current mapping returns False. It also does not propagate a genuine missing value (<NA>) from a nullable dtype such as Int64.
> This subtask makes the mapping match NumPy for signed zero and for nullable-dtype nulls, following the same approach recently used for copysign (SPARK-58630). Found while working on the SPARK-58532 umbrella.
--
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