code: def test_groupby_quantile_raises_on_invalid_dtype(q, numeric_only):
      df = DataFrame({"a": [1], "b": [2.0], "c": ["x"]})
      if numeric_only:
          result = df.groupby("a").quantile(
              q, numeric_only=numeric_only
          )
          expected = df.groupby("a")[["b"]].quantile(q)
          tm.assert_frame_equal(result, expected)
      else:
          with pytest.raises(
              TypeError,
              match="'quantile' cannot be performed against 'object' dtypes!",
          ):
              df.groupby("a").quantile(q, numeric_only=numeric_only)
  
imports: import numpy
  import pytest
  import pandas
  from pandas import DataFrame, Index
  import pandas._testing
label_desc: Use image node_id 12 for calling a global function with example usage: test_groupby_quantile_raises_on_invalid_dtype(q, numeric_only) without return types