Skip to content

Commit 5b45f4b

Browse files
authored
TST: remove unused kwargs in assert_sp_array_equal (#32525)
1 parent 00bb09d commit 5b45f4b

File tree

1 file changed

+7
-37
lines changed

1 file changed

+7
-37
lines changed

pandas/_testing.py

+7-37
Original file line numberDiff line numberDiff line change
@@ -1461,53 +1461,25 @@ def to_array(obj):
14611461
# Sparse
14621462

14631463

1464-
def assert_sp_array_equal(
1465-
left,
1466-
right,
1467-
check_dtype=True,
1468-
check_kind=True,
1469-
check_fill_value=True,
1470-
consolidate_block_indices=False,
1471-
):
1464+
def assert_sp_array_equal(left, right):
14721465
"""
14731466
Check that the left and right SparseArray are equal.
14741467
14751468
Parameters
14761469
----------
14771470
left : SparseArray
14781471
right : SparseArray
1479-
check_dtype : bool, default True
1480-
Whether to check the data dtype is identical.
1481-
check_kind : bool, default True
1482-
Whether to just the kind of the sparse index for each column.
1483-
check_fill_value : bool, default True
1484-
Whether to check that left.fill_value matches right.fill_value
1485-
consolidate_block_indices : bool, default False
1486-
Whether to consolidate contiguous blocks for sparse arrays with
1487-
a BlockIndex. Some operations, e.g. concat, will end up with
1488-
block indices that could be consolidated. Setting this to true will
1489-
create a new BlockIndex for that array, with consolidated
1490-
block indices.
14911472
"""
14921473
_check_isinstance(left, right, pd.arrays.SparseArray)
14931474

1494-
assert_numpy_array_equal(left.sp_values, right.sp_values, check_dtype=check_dtype)
1475+
assert_numpy_array_equal(left.sp_values, right.sp_values)
14951476

14961477
# SparseIndex comparison
14971478
assert isinstance(left.sp_index, pd._libs.sparse.SparseIndex)
14981479
assert isinstance(right.sp_index, pd._libs.sparse.SparseIndex)
14991480

1500-
if not check_kind:
1501-
left_index = left.sp_index.to_block_index()
1502-
right_index = right.sp_index.to_block_index()
1503-
else:
1504-
left_index = left.sp_index
1505-
right_index = right.sp_index
1506-
1507-
if consolidate_block_indices and left.kind == "block":
1508-
# we'll probably remove this hack...
1509-
left_index = left_index.to_int_index().to_block_index()
1510-
right_index = right_index.to_int_index().to_block_index()
1481+
left_index = left.sp_index
1482+
right_index = right.sp_index
15111483

15121484
if not left_index.equals(right_index):
15131485
raise_assert_detail(
@@ -1517,11 +1489,9 @@ def assert_sp_array_equal(
15171489
# Just ensure a
15181490
pass
15191491

1520-
if check_fill_value:
1521-
assert_attr_equal("fill_value", left, right)
1522-
if check_dtype:
1523-
assert_attr_equal("dtype", left, right)
1524-
assert_numpy_array_equal(left.to_dense(), right.to_dense(), check_dtype=check_dtype)
1492+
assert_attr_equal("fill_value", left, right)
1493+
assert_attr_equal("dtype", left, right)
1494+
assert_numpy_array_equal(left.to_dense(), right.to_dense())
15251495

15261496

15271497
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)