def assert_sp_array_equal(left, right, check_dtype=True, check_kind=True,<EOL>check_fill_value=True,<EOL>consolidate_block_indices=False):
_check_isinstance(left, right, pd.SparseArray)<EOL>assert_numpy_array_equal(left.sp_values, right.sp_values,<EOL>check_dtype=check_dtype)<EOL>assert isinstance(left.sp_index, pd._libs.sparse.SparseIndex)<EOL>assert isinstance(right.sp_index, pd._libs.sparse.SparseIndex)<EOL>if not check_kind:<EOL><INDENT>left_index = left.sp_index.to_block_index()<EOL>right_index = right.sp_index.to_block_index()<EOL><DEDENT>else:<EOL><INDENT>left_index = left.sp_index<EOL>right_index = right.sp_index<EOL><DEDENT>if consolidate_block_indices and left.kind == '<STR_LIT>':<EOL><INDENT>left_index = left_index.to_int_index().to_block_index()<EOL>right_index = right_index.to_int_index().to_block_index()<EOL><DEDENT>if not left_index.equals(right_index):<EOL><INDENT>raise_assert_detail('<STR_LIT>', '<STR_LIT>',<EOL>left_index, right_index)<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT>if check_fill_value:<EOL><INDENT>assert_attr_equal('<STR_LIT>', left, right)<EOL><DEDENT>if check_dtype:<EOL><INDENT>assert_attr_equal('<STR_LIT>', left, right)<EOL><DEDENT>assert_numpy_array_equal(left.values, right.values,<EOL>check_dtype=check_dtype)<EOL>
Check that the left and right SparseArray are equal.

    Parameters
    ----------
    left : SparseArray
    right : SparseArray
    check_dtype : bool, default True
        Whether to check the data dtype is identical.
    check_kind : bool, default True
        Whether to just the kind of the sparse index for each column.
    check_fill_value : bool, default True
        Whether to check that left.fill_value matches right.fill_value
    consolidate_block_indices : bool, default False
        Whether to consolidate contiguous blocks for sparse arrays with
        a BlockIndex. Some operations, e.g. concat, will end up with
        block indices that could be consolidated. Setting this to true will
        create a new BlockIndex for that array, with consolidated
        block indices.