code: def _numeric_agg(
      self, function: str, cols: Sequence[str]
  ) -> "DataFrame":
      from pyspark.sql.connect.dataframe import DataFrame
  
      assert isinstance(function, str) and function in [
          "min",
          "max",
          "avg",
          "sum",
      ]
  
      assert isinstance(cols, list) and all(
          isinstance(c, str) for c in cols
      )
  
      schema = self._df.schema
  
      numerical_cols: List[str] = [
          field.name
          for field in schema.fields
          if isinstance(field.dataType, NumericType)
      ]
  
      agg_cols: List[str] = []
  
      if len(cols) > 0:
          invalid_cols = [c for c in cols if c not in numerical_cols]
          if len(invalid_cols) > 0:
              raise PySparkTypeError(
                  error_class="NOT_NUMERIC_COLUMNS",
                  message_parameters={
                      "invalid_columns": str(invalid_cols)
                  },
              )
          agg_cols = cols
      else:
          # if no column is provided, then all numerical columns are selected
          agg_cols = numerical_cols
  
      return DataFrame(
          plan.Aggregate(
              child=self._df._plan,
              group_type=self._group_type,
              grouping_cols=self._grouping_cols,
              aggregate_cols=[
                  _invoke_function(function, col(c)) for c in agg_cols
              ],
              pivot_col=self._pivot_col,
              pivot_values=self._pivot_values,
              grouping_sets=self._grouping_sets,
          ),
          session=self._df._session,
      )
  
imports: from pyspark.sql.connect.utils import check_dependencies
  import warnings
  from typing import Any, Dict, List, Sequence, Union, TYPE_CHECKING, Optional, overload, cast
  from pyspark.rdd import PythonEvalType
  from pyspark.sql.group import GroupedData
  from pyspark.sql.pandas.group_ops import PandasCogroupedOps
  from pyspark.sql.types import NumericType
  from pyspark.sql.types import StructType
  import pyspark.sql.connect.plan
  from pyspark.sql.connect.column import Column
  from pyspark.sql.connect.functions.builtin import _invoke_function, col, lit
  from pyspark.errors import PySparkNotImplementedError, PySparkTypeError
label_desc: Use image node_id 6 for calling the GroupedData obj's underlying member method code with example usage: obj._numeric_agg(function, cols) and returns: DataFrame