StackingRegressor is incompatible with TimeSeriesSplit as cv parameter, raising "ValueError: cross_val_predict only works for partitions"

https://github.com/scikit-learn/scikit-learn/blob/0f9b6a6c0bbbcbbb7f509016fa1006facfe1ba8d/sklearn/model_selection/_validation.py#L1185

### `scikit-learn` version and operating system

scikit-learn version: 1.5.2 (also affects 1.4.x)
Operating System: (e.g., macOS, Windows, Linux)
Python version: (e.g., 3.10)

### The bug

When using `StackingRegressor` (or `StackingClassifier`), passing a `TimeSeriesSplit` object to the `cv` parameter fails, raising a `ValueError: cross_val_predict only works for partitions`.

This check is fundamentally incompatible with `TimeSeriesSplit`, which correctly reserves the initial chunk of data for training and never uses it as a test set.

This bug makes it impossible to use `StackingRegressor` for time-series forecasting without resorting to a leaky workaround like `KFold(shuffle=False)`.

### Steps/Code to Reproduce

Here is a minimal reproducible example:

```python
import numpy as np
import sklearn
from sklearn.model_selection import TimeSeriesSplit, KFold
from sklearn.ensemble import StackingRegressor
from sklearn.linear_model import LinearRegression

print(f"scikit-learn version: {sklearn.__version__}")

# 1. Create dummy time-series data
X = np.random.rand(100, 2)
y = np.random.rand(100)

# 2. Define estimators
estimators = [
    ('lr1', LinearRegression()),
    ('lr2', LinearRegression())
]

# 3. Define the TimeSeriesSplit (the correct tool for this)
# n_splits=5 will reserve the first 1/6th of data for training only.
tscv = TimeSeriesSplit(n_splits=5)

# 4. Create the Stacker using TimeSeriesSplit
stacker_tscv = StackingRegressor(
    estimators=estimators,
    final_estimator=LinearRegression(),
    cv=tscv  # Pass the TimeSeriesSplit
)

# 5. This will FAIL
try:
    print("\nAttempting to fit with TimeSeriesSplit...")
    stacker_tscv.fit(X, y)
    print("SUCCESS: TimeSeriesSplit worked.")
except ValueError as e:
    print(f"FAILED with TimeSeriesSplit: {e}")

# 6. Show the "workaround" that succeeds (but leaks data)
print("\nAttempting to fit with KFold(shuffle=False)...")
kf_cv = KFold(n_splits=5, shuffle=False)
stacker_kf = StackingRegressor(
    estimators=estimators,
    final_estimator=LinearRegression(),
    cv=kf_cv
)
try:
    stacker_kf.fit(X, y)
    print("SUCCESS: KFold(shuffle=False) worked.")
except Exception as e:
    print(f"FAILED with KFold(shuffle=False): {e}")
```

### Impact 
This bug effectively breaks **StackingRegressor** for all time-series applications. It forces users to choose between:

Downgrading to scikit-learn==1.3.2 (where this check did not exist?). Not entirely sure which version it got introduced! 

Using KFold(shuffle=False) as the cv parameter, which introduces severe data leakage and leads to invalid models.

COMMENT:
I don't understand why you say it's a bug. `StackingRegressor` requires a partition-inducing CV strategy to be correctly used. Otherwise, it's not possible to implement `fit_transform`, right?

EDIT: in the scikit-learn API, the `fit_transform` (and `transform`, `predict`, `predict_proba`...) methods are always expected to output the same number of rows as the number of rows of their input.

Labels: Needs Info