BUG: sparse: get_index_dtype is called in some places with ndarray as first arg