code: def test_not_case_sensitive_but_nonstring():
      """Checks TypeError is raised if case sensitive is explicitly set to
      False but the column being counted does not support `.str.lower()`.
      """
      df = pd.DataFrame(
          {
              "ok1": ["ABC", None, "zzz"],
              "ok2": pd.Categorical(["A", "b", "A"], ordered=False),
              "notok1": [1, 2, 3],
              "notok2": [b"ABC", None, b"zzz"],
          }
      )
  
      # acceptable string types
      for okcol in ["ok1", "ok2"]:
          _ = df.count_cumulative_unique(
              okcol,
              dest_column_name="ok_count",
              case_sensitive=False,
          )
  
      # forbidden data types
      msg = "case_sensitive=False can only be used with a string-like type.*"
      for notokcol in ["notok1", "notok2"]:
          with pytest.raises(TypeError, match=msg):
              _ = df.count_cumulative_unique(
                  notokcol,
                  dest_column_name="notok_count",
                  case_sensitive=False,
              )
  
file_path: pyjanitor/tests/functions/test_count_cumulative_unique.py
imports: import numpy
  import pandas
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: test_not_case_sensitive_but_nonstring() without return types