code: def test_exog_to_direct_TypeError_when_exog_not_pandas_series_or_dataframe():
      """
      Test TypeError is raised when exog is not a pandas Series or DataFrame.
      """
      exog = np.arange(7)
  
      err_msg = re.escape(
          f"`exog` must be a pandas Series or DataFrame. Got {type(exog)}."
      )
      with pytest.raises(TypeError, match=err_msg):
          exog_to_direct(exog=exog, steps=2)
  
file_path: skforecast/skforecast/utils/tests/test_exog_to_direct.py
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.utils import exog_to_direct
  from pandas.api.types import CategoricalDtype
label_desc: Use image node_id 1 for calling a global function with example usage: test_exog_to_direct_TypeError_when_exog_not_pandas_series_or_dataframe() without return types