code: def test_create_train_X_y_MissingValuesExogWarning_when_exog_has_missing_values():
      """
      Test create_train_X_y is issues a MissingValuesExogWarning when exog has missing values.
      """
      y = pd.Series(np.arange(4))
      exog = pd.Series([1, 2, 3, np.nan], name="exog")
      forecaster = ForecasterAutoreg(LinearRegression(), lags=2)
  
      warn_msg = re.escape(
          (
              "`exog` has missing values. Most machine learning models do "
              "not allow missing values. Fitting the forecaster may fail."
          )
      )
      with pytest.warns(MissingValuesExogWarning, match=warn_msg):
          forecaster.create_train_X_y(y=y, exog=exog)
  
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoreg import ForecasterAutoreg
  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_ForecasterAutoreg import data
label_desc: Use image node_id 2 for calling a global function with example usage: test_create_train_X_y_MissingValuesExogWarning_when_exog_has_missing_values() without return types