code: def test_recursive_predict_ValueError_when_fun_predictors_return_nan():
      """
      Test ValueError is raised when y and exog have different index.
      """
      forecaster = ForecasterAutoregCustom(
          regressor=LinearRegression(),
          fun_predictors=create_predictors,
          window_size=5,
      )
      forecaster.fit(
          y=pd.Series(
              np.arange(10),
              index=pd.date_range(
                  start="2022-01-01", periods=10, freq="1D"
              ),
          )
      )
  
      err_msg = re.escape(
          "`fun_predictors()` is returning `NaN` values."
      )
      with pytest.raises(ValueError, match=err_msg):
          forecaster._recursive_predict(
              last_window=np.array([np.nan]), steps=3
          )
  
file_path: skforecast/skforecast/ForecasterAutoregCustom/tests/test_recursive_predict.py
imports: from pytest import approx
  import pytest
  import re
  import numpy
  import pandas
  from skforecast.ForecasterAutoregCustom import ForecasterAutoregCustom
  from sklearn.linear_model import LinearRegression
label_desc: Use image node_id 2 for calling a global function with example usage: test_recursive_predict_ValueError_when_fun_predictors_return_nan() without return types