code: def test_feature_metadata(self):
      X_train, X_test, y_train, y_test, _, _ = create_cancer_data(
          return_dataframe=True
      )
      model = create_lightgbm_classifier(X_train, y_train)
  
      train = X_train.copy()
      test = X_test.copy()
      train[TARGET] = y_train
      test[TARGET] = y_test
  
      feature_metadata = FeatureMetadata(identity_feature_name="id")
      err_msg = (
          "The given identity feature name id is not present "
          f'in the provided features: {", ".join(X_train.columns)}.'
      )
      with pytest.raises(UserConfigValidationException, match=err_msg):
          RAIInsights(
              model=model,
              train=train,
              test=test,
              target_column=TARGET,
              task_type="classification",
              feature_metadata=feature_metadata,
          )
  
      feature_metadata = FeatureMetadata(identity_feature_name=TARGET)
      err_msg = (
          "The given identity feature name target is not present "
          f'in the provided features: {", ".join(X_train.columns)}.'
      )
      with pytest.raises(UserConfigValidationException, match=err_msg):
          RAIInsights(
              model=model,
              train=train,
              test=test,
              target_column=TARGET,
              task_type="classification",
              feature_metadata=feature_metadata,
          )
  
      feature_metadata = FeatureMetadata(dropped_features=[TARGET])
      err_msg = (
          "The given dropped feature target is not present "
          f'in the provided features: {", ".join(X_train.columns)}.'
      )
      with pytest.raises(UserConfigValidationException, match=err_msg):
          RAIInsights(
              model=model,
              train=train,
              test=test,
              target_column=TARGET,
              task_type="classification",
              feature_metadata=feature_metadata,
          )
  
      feature_metadata = FeatureMetadata(datetime_features=[TARGET])
      err_msg = (
          "The given datetime feature target is not present "
          f'in the provided features: {", ".join(X_train.columns)}.'
      )
      with pytest.raises(UserConfigValidationException, match=err_msg):
          RAIInsights(
              model=model,
              train=train,
              test=test,
              target_column=TARGET,
              task_type="classification",
              feature_metadata=feature_metadata,
          )
  
      feature_metadata = FeatureMetadata(
          time_series_id_features=[TARGET]
      )
      err_msg = (
          "The given time series ID feature target is not present "
          f'in the provided features: {", ".join(X_train.columns)}.'
      )
      with pytest.raises(UserConfigValidationException, match=err_msg):
          RAIInsights(
              model=model,
              train=train,
              test=test,
              target_column=TARGET,
              task_type="classification",
              feature_metadata=feature_metadata,
          )
  
imports: import logging
  import random
  from unittest.mock import MagicMock
  import numpy
  import pandas
  import pytest
  from lightgbm import LGBMClassifier
  from tests.common_utils import RandomForecastingModel, RandomForecastingModelWithQuantiles, create_iris_data, create_tiny_forecasting_dataset
  from rai_test_utils.datasets.tabular import create_binary_classification_dataset, create_cancer_data, create_housing_data
  from rai_test_utils.models.lightgbm import create_lightgbm_classifier
  from rai_test_utils.models.sklearn import create_sklearn_random_forest_regressor
  from raiutils.exceptions import UserConfigValidationException
  from responsibleai import RAIInsights
  from responsibleai.feature_metadata import FeatureMetadata
  from responsibleai.rai_insights.rai_insights import _MODEL_METHOD_EXCEPTION_MESSAGE
label_desc: Use image node_id 19 for calling the TestRAIInsightsValidations obj's underlying member method code with example usage: obj.test_feature_metadata() without return types