Haotian Sun created SPARK-58718:
-----------------------------------
Summary: 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: 5.0.0
Reporter: Haotian Sun
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: [email protected]
For additional commands, e-mail: [email protected]