Skip to content

Commit 67b547a

Browse files
YikunHyukjinKwon
authored andcommitted
[SPARK-36230][SPARK-36232][PYTHON] Add regression for hasnan of Decimal(NaN)
### What changes were proposed in this pull request? This patch add the regression test for: - SPARK-36232: Add decimal(NaN) create check with arrow disable(default) - SPARK-36230: Add decimal hasnan test ### Why are the changes needed? These issues had been resolved after apache#34285 merged ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? test case Closes apache#34299 from Yikun/SPARK-36230. Authored-by: Yikun Jiang <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
1 parent ef3eb90 commit 67b547a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

python/pyspark/pandas/tests/test_series.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import inspect
2222
from itertools import product
2323
from datetime import datetime, timedelta
24+
from decimal import Decimal
2425

2526
import numpy as np
2627
import pandas as pd
@@ -2558,6 +2559,11 @@ def test_hasnans(self):
25582559
psser = ps.from_pandas(pser)
25592560
self.assert_eq(pser.hasnans, psser.hasnans)
25602561

2562+
# DecimalType
2563+
pser = pd.Series([Decimal("0.1"), Decimal("NaN")])
2564+
psser = ps.from_pandas(pser)
2565+
self.assert_eq(pser.hasnans, psser.hasnans)
2566+
25612567
# empty
25622568
pser = pd.Series([])
25632569
psser = ps.from_pandas(pser)

0 commit comments

Comments
 (0)