code: def test_create_lags_exception_when_len_of_y_is_lower_than_maximum_lag():
      """
      Test exception is raised when length of y is lower than maximum lag included
      in the forecaster.
      """
      y = pd.Series(np.arange(5), name="y")
      forecaster = ForecasterAutoreg(LinearRegression(), lags=10)
      err_msg = re.escape(
          (
              f"The maximum lag ({forecaster.max_lag}) must be less than the length "
              f"of the series ({len(y)})."
          )
      )
      with pytest.raises(ValueError, match=err_msg):
          forecaster._create_lags(y=y)
  
file_path: skforecast/skforecast/ForecasterAutoreg/tests/test_create_lags.py
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoreg import ForecasterAutoreg
  from sklearn.linear_model import LinearRegression
label_desc: Use image node_id 1 for calling a global function with example usage: test_create_lags_exception_when_len_of_y_is_lower_than_maximum_lag() without return types