code: def sum(self, on: str, ignore_nulls: bool) -> Optional[U]:
      pd = lazy_import_pandas()
      if on is not None and not isinstance(on, str):
          raise ValueError(
              "on must be a string or None when aggregating on Pandas blocks, but "
              f"got: {type(on)}."
          )
  
      if self.num_rows() == 0:
          return None
  
      col = self._table[on]
      if col.isnull().all():
          # Short-circuit on an all-null column, returning None. This is required for
          # sum() since it will otherwise return 0 when summing on an all-null column,
          # which is not what we want.
          return None
      val = col.sum(skipna=ignore_nulls)
      if pd.isnull(val):
          return None
      return val
  
imports: import collections
  import heapq
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Tuple, TypeVar, Union
  import numpy
  from ray.air.constants import TENSOR_COLUMN_NAME
  from ray.data._internal.table_block import TableBlockAccessor, TableBlockBuilder
  from ray.data._internal.util import find_partitions
  from ray.data.block import Block, BlockAccessor, BlockExecStats, BlockMetadata, KeyType, U
  from ray.data.context import DataContext
  from ray.data.row import TableRow
label_desc: Use image node_id 21 for calling the PandasBlockAccessor obj's underlying member method code with example usage: obj.sum(on, ignore_nulls) and returns: val, None, None, None