code: def test_table_type_cast():
      table = wandb.Table(columns=["type_col"])
      table.add_data(1)
  
      wb_classes = data_types.Classes(
          [
              {"id": 1, "name": "cat"},
              {"id": 2, "name": "dog"},
              {"id": 3, "name": "horse"},
          ]
      )
  
      table.cast("type_col", wb_classes.get_type())
      table.add_data(2)
  
      with pytest.raises(TypeError):
          table.add_data(4)
  
imports: import datetime
  import numpy
  import pytest
  import wandb
  from wandb import data_types
  from wandb.sdk.data_types._dtypes import AnyType, BooleanType, ConstType, InvalidType, ListType, NoneType, NumberType, OptionalType, StringType, TimestampType, TypedDictType, TypeRegistry, UnionType, UnknownType
label_desc: Use image node_id 24 for calling a global function with example usage: test_table_type_cast() without return types