array must be SparseSeries or SparseArray

def _maybe_to_sparse(array):
    """
    array must be SparseSeries or SparseArray
    """
    if isinstance(array, ABCSparseSeries):
        array = array.values.copy()
    return array