code: def test_create_table_index_data_columns_argument(setup_path):
      # GH 28156
  
      with ensure_clean_store(setup_path) as store:
  
          def col(t, column):
              return getattr(store.get_storer(t).table.cols, column)
  
          # data columns
          df = DataFrame(
              np.random.default_rng(2).standard_normal((10, 4)),
              columns=Index(list("ABCD"), dtype=object),
              index=date_range("2000-01-01", periods=10, freq="B"),
          )
          df["string"] = "foo"
          df["string2"] = "bar"
          store.append("f", df, data_columns=["string"])
          assert col("f", "index").is_indexed is True
          assert col("f", "string").is_indexed is True
  
          msg = "'Cols' object has no attribute 'string2'"
          with pytest.raises(AttributeError, match=msg):
              col("f", "string2").is_indexed
  
          # try to index a col which isn't a data_column
          msg = (
              "column string2 is not a data_column.\n"
              "In order to read column string2 you must reload the dataframe \n"
              "into HDFStore and include string2 with the data_columns argument."
          )
          with pytest.raises(AttributeError, match=msg):
              store.create_table_index("f", columns=["string2"])
  
imports: import contextlib
  import datetime
  import hashlib
  import tempfile
  import time
  import numpy
  import pytest
  import pandas
  from pandas import DataFrame, DatetimeIndex, Index, MultiIndex, Series, Timestamp, concat, date_range, period_range, timedelta_range
  import pandas._testing
  from pandas.tests.io.pytables.common import _maybe_remove, ensure_clean_store
  from pandas.io.pytables import HDFStore, read_hdf
label_desc: Use image node_id 14 for calling a global function with example usage: test_create_table_index_data_columns_argument(setup_path) and returns: getattr