code: def test_create_train_X_y_ValueError_fun_predictors_return_nan_values():
      """
      Test ValueError is raised when fun_predictors returns `NaN` values.
      """
      forecaster = ForecasterAutoregCustom(
          regressor=LinearRegression(),
          fun_predictors=lambda y: np.array([np.nan, np.nan]),
          window_size=5,
      )
  
      err_msg = re.escape(
          "`fun_predictors()` is returning `NaN` values."
      )
      with pytest.raises(ValueError, match=err_msg):
          forecaster.fit(y=pd.Series(np.arange(50)))
  
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoregCustom import ForecasterAutoregCustom
  from skforecast.preprocessing import TimeSeriesDifferentiator
  from skforecast.exceptions import MissingValuesExogWarning
  from sklearn.linear_model import LinearRegression
  from sklearn.compose import ColumnTransformer
  from sklearn.preprocessing import StandardScaler
  from sklearn.preprocessing import OneHotEncoder
  from .fixtures_ForecasterAutoregCustom import data
label_desc: Use image node_id 8 for calling a global function with example usage: test_create_train_X_y_ValueError_fun_predictors_return_nan_values() without return types