TypeError: Expected sequence or array-like, got <class 'int'>

### Describe the bug

I built **sklearn v1.1dev0** from source following this **[here](https://scikit-learn.org/stable/developers/advanced_installation.html)** 

I am not sure it's a bug or not, but I get this:

```
Traceback (most recent call last):
  File "/home/utilisateur/kabartay/cloned/sport/football-bets/main/scikit-learn/sklearn/model_selection/_validation.py", line 687, in _fit_and_score
    estimator.fit(X_train, y_train, **fit_params)
  File "/home/scikit-learn/sklearn/pipeline.py", line 382, in fit
    self._final_estimator.fit(Xt, y, **fit_params_last_step)
  File "/home/scikit-learn/sklearn/calibration.py", line 283, in fit
    check_consistent_length(y, sample_aligned_params)
  File "/home/scikit-learn/sklearn/utils/validation.py", line 378, in check_consistent_length
    lengths = [_num_samples(X) for X in arrays if X is not None]
  File "/home/scikit-learn/sklearn/utils/validation.py", line 378, in <listcomp>
    lengths = [_num_samples(X) for X in arrays if X is not None]
  File "/home/scikit-learn/sklearn/utils/validation.py", line 317, in _num_samples
    raise TypeError(message)
TypeError: Expected sequence or array-like, got <class 'int'>
```

caused by 

```
File "/home/main/train_pipe_dev.py", line 301, in train_model
    model.fit(x_train, y_train, **fit_params)
  File "/home/scikit-learn/sklearn/model_selection/_search.py", line 875, in fit
    self._run_search(evaluate_candidates)
  File "/home/scikit-learn/sklearn/model_selection/_search.py", line 1375, in _run_search
    evaluate_candidates(ParameterGrid(self.param_grid))
  File "/home/scikit-learn/sklearn/model_selection/_search.py", line 852, in evaluate_candidates
    _warn_or_raise_about_fit_failures(out, self.error_score)
  File "/home/scikit-learn/sklearn/model_selection/_validation.py", line 368, in _warn_or_raise_about_fit_failures
    raise ValueError(all_fits_failed_message)
ValueError: 
```

I tried to git clone the source and build it step by step and getting that some tests for **v1.1.dev0** fails with TypeError:
Please check my investigation [here](https://github.com/scikit-learn/scikit-learn/pull/18170#issuecomment-1065171823) at pull [#18170](https://github.com/scikit-learn/scikit-learn/pull/18170)
Might that related? Any idea?


### Steps/Code to Reproduce

(code to be very big)
some eaxample what I wanted to do  is [here](https://github.com/scikit-learn/scikit-learn/pull/18170#issuecomment-1064410023)

What I am trying is to use Pipeline with CalibratedClassifierCV with ANN as base estimator and running GridSearchCV with it. 
Pipeline passes fit_params well, but I needed fit_params in CalibratedClassifierCV (which is under dev and be released in v1.1 stable, check [#18170](https://github.com/scikit-learn/scikit-learn/pull/18170) ) to pass for ANN estimator that requires some epochs, patience, batch size parameters control. 

### Expected Results

I expect smotth run of model.fit(X,y, **fit_params) where X is data DataFrame and y is target list/array.
No issue for stable sklearn versions, thus expected issue comes from dev version.

### Actual Results

Check above

### Versions

```shell
Python 3.8.12 | packaged by conda-forge | (default, Jan 30 2022, 23:53:36) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sklearn; sklearn.show_versions()

System:
    python: 3.8.12 | packaged by conda-forge | (default, Jan 30 2022, 23:53:36)  [GCC 9.4.0]
executable: /home/user/anaconda3/envs/sklearn-env/bin/python3
   machine: Linux-5.13.0-28-generic-x86_64-with-glibc2.10

Python dependencies:
      sklearn: 1.1.dev0
          pip: 21.0
   setuptools: 49.2.0
        numpy: 1.21.0
        scipy: 1.4.1
       Cython: 0.29.28
       pandas: 1.1.5
   matplotlib: 3.3.4
       joblib: 1.0.1
threadpoolctl: 2.1.0

Built with OpenMP: True

threadpoolctl info:
       filepath: /home/user/anaconda3/envs/sklearn-env/lib/libgomp.so.1.0.0
         prefix: libgomp
       user_api: openmp
   internal_api: openmp
        version: None
    num_threads: 12

       filepath: /home/user/.local/lib/python3.8/site-packages/numpy.libs/libopenblasp-r0-5bebc122.3.13.dev.so
         prefix: libopenblas
       user_api: blas
   internal_api: openblas
        version: 0.3.13.dev
    num_threads: 12
threading_layer: pthreads

       filepath: /home/user/.local/lib/python3.8/site-packages/scipy.libs/libopenblasp-r0-085ca80a.3.9.so
         prefix: libopenblas
       user_api: blas
   internal_api: openblas
        version: 0.3.9
    num_threads: 12
threading_layer: pthreads
```

COMMENT:
Hi @thomasjpfan,

I managed to fix all errors and make everything running a month ago with **v1.1.dev0**. 
I think, this issue can be closed, @glemaitre @thomasjpfan, since no more valid.
But I have one small things to discuss before this issue is closed.

Few days ago I tried the stable **v1.1.0** with same code. 
First of all, thanks for the new stable release with `CalibratedClassifierCV` with `fit_params`, a lot more useful features which I use in depth, amazing job done by sklearn team and I really appreciate that.

So, I have some issue (I "fixed" it manually before 1.1.0 stable release, just avoiding consistency checks, not safe solution surely) when I do `.fit(X,y)`:

```
File "/home/anaconda3/envs/sklearn11/lib/python3.9/site-packages/sklearn/model_selection/_validation.py", line 367, in _warn_or_raise_about_fit_failures
    raise ValueError(all_fits_failed_message)
ValueError: 
All the 80 fits failed.
It is is very likely that your model is misconfigured.
You can try to debug the error by setting error_score='raise'.
```

80 fits failed with the following error:
```
Traceback (most recent call last):
  File "/home/anaconda3/envs/sklearn11/lib/python3.9/site-packages/sklearn/model_selection/_validation.py", line 686, in _fit_and_score
    estimator.fit(X_train, y_train, **fit_params)
  File "/home/anaconda3/envs/sklearn11/lib/python3.9/site-packages/sklearn/pipeline.py", line 382, in fit
    self._final_estimator.fit(Xt, y, **fit_params_last_step)
  File "/home/anaconda3/envs/sklearn11/lib/python3.9/site-packages/sklearn/calibration.py", line 283, in fit
    check_consistent_length(y, sample_aligned_params)
  File "/home/anaconda3/envs/sklearn11/lib/python3.9/site-packages/sklearn/utils/validation.py", line 383, in check_consistent_length
    raise ValueError(
ValueError: Found input variables with inconsistent numbers of samples: [1000, 1]
```

What can be the issue with `check_consistent_length` function in sklearn/utils/validation.py?
https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/utils/validation.py#L365

This is how the arrays are checked:

```
    lengths = [_num_samples(X) for X in arrays if X is not None]
    uniques = np.unique(lengths)
    if len(uniques) > 1:
        raise ValueError(
            "Found input variables with inconsistent numbers of samples: %r"
            % [int(l) for l in lengths]
        )
```

Just wondering why shapes are not the same, probably issue from my side, but I wanted to be sure might I should provide arrays in specific format, not DataFrames, etc. 

Thanks.

Labels: Bug, Needs Reproducible Code