code: def test_func_aggregator_invalid_input_data(cat_series):
      # note: it is the user's responsibility to ensure that the input data is valid
      def treat_string_as_numeric_data(x):
          return np.mean(x)
  
      n = np.random.randint(100, len(cat_series) / 3)
      with pytest.raises(TypeError):
          FuncAggregator(
              aggregation_func=treat_string_as_numeric_data
          ).aggregate(
              cat_series.index.values, cat_series.to_numpy(), n_out=n
          )
  
imports: import numpy
  import pandas
  import pytest
  from pytest_lazyfixture import lazy_fixture
  from plotly_resampler.aggregation import LTTB, EveryNthPoint, FuncAggregator, MedDiffGapHandler, MinMaxAggregator, MinMaxLTTB, MinMaxOverlapAggregator, NoGapHandler
  from .utils import construct_index, wrap_aggregate
label_desc: Use image node_id 12 for calling a global function with example usage: test_func_aggregator_invalid_input_data(cat_series) and returns: np