code: def get_categorical_cols(df):
      """
      Returns names of categorical columns in the DataFrame. These
      include columns of types: object, category, string, string[pyarrow].
      """
      obj_cols = []
      for col, dtype in df.dtypes.items():
          if (
              is_object_dtype(dtype)
              or is_category(dtype)
              or is_string_dtype(dtype)
          ):
              obj_cols.append(col)
  
      if not obj_cols:
          print(
              "Warning: No categorical columns found. Calling 'transform' will only return input data."
          )
  
      return obj_cols
  
imports: from abc import abstractmethod
  from enum import Enum, auto
  import warnings
  import pandas
  import numpy
  import sklearn.base
  from pandas.api.types import is_object_dtype, is_string_dtype, is_numeric_dtype
  from pandas.core.dtypes.dtypes import CategoricalDtype
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.exceptions import NotFittedError
  from typing import Dict, List, Optional, Union
  from scipy.sparse import csr_matrix
  from sklearn.preprocessing import LabelEncoder
label_desc: Use image node_id 2 for calling a global function with example usage: get_categorical_cols(df) and returns: obj_cols