code: def test_raises_error_when_nan_in_transform_df(df_datetime):
      transformer = DatetimeFeatures()
      transformer.fit(df_datetime)
      # dataset containing nans
      with pytest.raises(ValueError):
          transformer.transform(dates_nan)
      transformer = DatetimeFeatures(variables="index")
      transformer.fit(dates_idx_dt)
      with pytest.raises(ValueError):
          transformer.transform(dates_idx_nan)
  
imports: import numpy
  import pandas
  import pytest
  from sklearn.exceptions import NotFittedError
  from sklearn.pipeline import Pipeline
  from feature_engine.datetime import DatetimeFeatures
  from feature_engine.datetime._datetime_constants import FEATURES_DEFAULT, FEATURES_SUFFIXES, FEATURES_SUPPORTED
label_desc: Use image node_id 11 for calling a global function with example usage: test_raises_error_when_nan_in_transform_df(df_datetime) without return types