and passed to scikit-learn"s ``check_array`` with all the additional
arguments.
accept_dask_array = kwargs.pop("accept_dask_array", True)
preserve_pandas_dataframe = kwargs.pop("preserve_pandas_dataframe", False)
accept_dask_dataframe = kwargs.pop("accept_dask_dataframe", False)
accept_unknown_chunks = kwargs.pop("accept_unknown_chunks", False)
accept_multiple_blocks = kwargs.pop("accept_multiple_blocks", False)
After Change
if min(array.chunks[0]) == 0:
// scikit-learn does not gracefully handle length-0 chunks
// in some cases (e.g. pairwise_distances).
chunks2 = tuple(xfor x in array.chunks[0] if x != 0)
array = array.rechunk({0: chunks2})
// hmmm, we want to catch things like shape errors.