class_docstr: Defines the top-level Model Analysis API.
  Use RAIInsights to analyze errors, explain the most important
  features, compute counterfactuals and run causal analysis in a
  single API.
class_docstr_tok: ["Defines","the","top-level","Model","Analysis","API",".","Use","RAIInsights","to","analyze","errors",",","explain","the","most","important","features",",","compute","counterfactuals","and","run","causal","analysis","in","a","single","API","."]
docstr: Get feature ranges like min, max and unique values for all columns.
  :param test: the test dataset
  :type test: pandas.DataFrame
  :param categorical_features: list of categorical feature names
  :type categorical_features: List[str]
  :param feature_columns: list of feature names
  :type feature_columns: List[str]
  :param datetime_features: list of datetime feature names
  :type datetime_features: Optional[List[str]]
docstr_tok: ["Get","feature","ranges","like","min",",","max","and","unique","values","for","all","columns",".",":","param","test",":","the","test","dataset",":","type","test",":","pandas.DataFrame",":","param","categorical_features",":","list","of","categorical","feature","names",":","type","categorical_features",":","List","[","str","]",":","param","feature_columns",":","list","of","feature","names",":","type","feature_columns",":","List","[","str","]",":","param","datetime_features",":","list","of","datetime","feature","names",":","type","datetime_features",":","Optional","[","List","[","str","]","]"]
code: def _get_feature_ranges(
      test: pd.DataFrame,
      categorical_features: List[str],
      feature_columns: List[str],
      datetime_features: Optional[List[str]] = None,
  ):
      """Get feature ranges like min, max and unique values for all columns.
      :param test: the test dataset
      :type test: pandas.DataFrame
      :param categorical_features: list of categorical feature names
      :type categorical_features: List[str]
      :param feature_columns: list of feature names
      :type feature_columns: List[str]
      :param datetime_features: list of datetime feature names
      :type datetime_features: Optional[List[str]]
      """
      result = []
      for col in feature_columns:
          res_object = {_COLUMN_NAME: col}
          if col in categorical_features:
              unique_value = test[col].unique()
              res_object[_RANGE_TYPE] = "categorical"
              res_object[_UNIQUE_VALUES] = unique_value.tolist()
          elif (
              datetime_features is not None and col in datetime_features
          ):
              res_object[_RANGE_TYPE] = "datetime"
              res_object[_MIN_VALUE] = (
                  test[col].min().strftime(_STRF_TIME_FORMAT)
              )
              res_object[_MAX_VALUE] = (
                  test[col].max().strftime(_STRF_TIME_FORMAT)
              )
          else:
              col_min = test[col].min()
              col_max = test[col].max()
              try:
                  min_value = float(col_min)
                  max_value = float(col_max)
              except Exception as e:
                  raise SystemErrorException(
                      "Unable to convert min or max value "
                      f"of feature column {col} to float. "
                      f"min value of {col} is of type {type(col_min)} and "
                      f"max value of {col} is of type {type(col_max)} "
                      f"Original Excepton: {e}"
                  )
              res_object[_RANGE_TYPE] = "integer"
              res_object[_MIN_VALUE] = min_value
              res_object[_MAX_VALUE] = max_value
          result.append(res_object)
      return result
  
imports: import json
  import pickle
  import warnings
  from enum import Enum
  from pathlib import Path
  from typing import Any, List, Optional, Union
  import numpy
  import pandas
  from erroranalysis._internal.cohort_filter import FilterDataWithCohortFilters
  from erroranalysis._internal.process_categoricals import process_categoricals
  from raiutils.data_processing import convert_to_list
  from raiutils.exceptions import SystemErrorException, UserConfigValidationException
  from raiutils.models import Forecasting, ModelTask, SKLearn
  from responsibleai._interfaces import Dataset, RAIInsightsData, TabularDatasetMetadata
  from responsibleai._internal._forecasting_wrappers import _wrap_model
  from responsibleai._internal.constants import FileFormats, ManagerNames, Metadata, SerializationAttributes
  from responsibleai.feature_metadata import FeatureMetadata
  from responsibleai.managers.causal_manager import CausalManager
  from responsibleai.managers.counterfactual_manager import CounterfactualManager
  from responsibleai.managers.data_balance_manager import DataBalanceManager
  from responsibleai.managers.error_analysis_manager import ErrorAnalysisManager
  from responsibleai.managers.explainer_manager import ExplainerManager
  from responsibleai.rai_insights.rai_base_insights import RAIBaseInsights
label_desc: Use image node_id 34 for calling the RAIInsights obj's underlying member method code with example usage: obj._get_feature_ranges(test, categorical_features, feature_columns, datetime_features) and returns: result