Skip to content

Commit 58ad69b

Browse files
create new test
1 parent 3e9cac3 commit 58ad69b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pandas/tests/frame/methods/test_combine_first.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,21 @@ def test_combine_first_string_dtype_only_na(self, nullable_string_dtype):
398398
).set_index(["a", "b"])
399399
tm.assert_frame_equal(result, expected)
400400

401+
@pytest.mark.parametrize(
402+
"wide_val, dtype",
403+
(
404+
(1666880195890293744, "UInt64"),
405+
(-1666880195890293744, "Int64"),
406+
),
407+
)
408+
def test_combine_first_preserve_EA_precision(self, wide_val, dtype):
409+
# GH#60128
410+
df1 = DataFrame({"A": [wide_val, 5]}, dtype=dtype)
411+
df2 = DataFrame({"A": [6, 7, wide_val]}, dtype=dtype)
412+
result = df1.combine_first(df2)
413+
expected = DataFrame({"A": [wide_val, 5, wide_val]}, dtype=dtype)
414+
tm.assert_frame_equal(result, expected)
415+
401416

402417
@pytest.mark.parametrize(
403418
"scalar1, scalar2",

0 commit comments

Comments
 (0)