code: def test_extract_features_from_categorical_variable(
      df_datetime, df_datetime_transformed
  ):
      cat_date = pd.DataFrame(
          {"date_obj1": df_datetime["date_obj1"].astype("category")}
      )
      X = DatetimeFeatures(variables="date_obj1").fit_transform(
          cat_date
      )
      pd.testing.assert_frame_equal(
          X,
          df_datetime_transformed[
              ["date_obj1" + feat for feat in feat_names_default]
          ],
      )
  
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 17 for calling a global function with example usage: test_extract_features_from_categorical_variable(df_datetime, df_datetime_transformed) without return types