Skip to content

Commit d52f2ce

Browse files
Test for nested series equality #22400 (#47627)
* TST: Added test for consistent type with unique agg #22558 * TST: Added test for consistent type with unique agg #22558 * TST: Moved and restructured test #22558 * TST: Added test for nested series #22400 * TST: Added equality test for nested series #22400 Co-authored-by: Steven Rotondo <[email protected]>
1 parent 2141c1c commit d52f2ce

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

pandas/tests/util/test_assert_series_equal.py

+27
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import numpy as np
12
import pytest
23

34
from pandas.core.dtypes.common import is_extension_array_dtype
@@ -382,3 +383,29 @@ def test_assert_series_equal_identical_na(nulls_fixture):
382383
# while we're here do Index too
383384
idx = pd.Index(ser)
384385
tm.assert_index_equal(idx, idx.copy(deep=True))
386+
387+
388+
def test_identical_nested_series_is_equal():
389+
# GH#22400
390+
x = Series(
391+
[
392+
0,
393+
0.0131142231938,
394+
1.77774652865e-05,
395+
np.array([0.4722720840328748, 0.4216929783681722]),
396+
]
397+
)
398+
y = Series(
399+
[
400+
0,
401+
0.0131142231938,
402+
1.77774652865e-05,
403+
np.array([0.4722720840328748, 0.4216929783681722]),
404+
]
405+
)
406+
# These two arrays should be equal, nesting could cause issue
407+
408+
tm.assert_series_equal(x, x)
409+
tm.assert_series_equal(x, x, check_exact=True)
410+
tm.assert_series_equal(x, y)
411+
tm.assert_series_equal(x, y, check_exact=True)

0 commit comments

Comments
 (0)