code: def test_imputer_forecaster_y():
      """Test that forecaster imputer works with y.
  
      Failure case in bug #5284.
      """
      from sklearn.linear_model import LinearRegression
  
      from sktime.datasets import load_airline
      from sktime.forecasting.compose import YfromX
  
      X = load_airline()
      y = load_airline()
  
      model_reg = YfromX(LinearRegression())
      model_reg.fit(X, y)
      transformer = Imputer(method="forecaster", forecaster=model_reg)
  
      transformer.fit(X=X, y=y)
      transformer.transform(X=X, y=y)
  
imports: import numpy
  import pytest
  from sktime.forecasting.naive import NaiveForecaster
  from sktime.transformations.series.impute import Imputer
  from sktime.utils._testing.forecasting import make_forecasting_problem
  from sktime.utils._testing.hierarchical import _make_hierarchical
label_desc: Use image node_id 2 for calling a global function with example usage: test_imputer_forecaster_y() without return types