code: def test_frame_or_series_compound_dtypes(self, frame_or_series):
      # see gh-5191
      # Compound dtypes should raise NotImplementedError.
  
      def f(dtype):
          return construct(
              frame_or_series, shape=3, value=1, dtype=dtype
          )
  
      msg = (
          "compound dtypes are not implemented "
          f"in the {frame_or_series.__name__} constructor"
      )
  
      with pytest.raises(NotImplementedError, match=msg):
          f([("A", "datetime64[h]"), ("B", "str"), ("C", "int32")])
  
      # these work (though results may be unexpected)
      f("int64")
      f("float64")
      f("M8[ns]")
  
imports: from copy import copy, deepcopy
  import numpy
  import pytest
  from pandas.core.dtypes.common import is_scalar
  from pandas import DataFrame, Index, Series, date_range
  import pandas._testing
label_desc: Use image node_id 4 for calling the TestGeneric obj's underlying member method code with example usage: obj.test_frame_or_series_compound_dtypes(frame_or_series) and returns: construct