class_docstr: Row of a tabular Dataset backed by a Arrow Table block.
class_docstr_tok: ["Row","of","a","tabular","Dataset","backed","by","a","Arrow","Table","block","."]
code: def __getitem__(self, key: Union[str, List[str]]) -> Any:
      from ray.data.extensions.tensor_extension import (
          ArrowTensorType,
          ArrowVariableShapedTensorType,
      )
  
      def get_item(keys: List[str]) -> Any:
          schema = self._row.schema
          if isinstance(
              schema.field(keys[0]).type,
              (ArrowTensorType, ArrowVariableShapedTensorType),
          ):
              # Build a tensor row.
              return tuple(
                  [
                      ArrowBlockAccessor._build_tensor_row(
                          self._row, col_name=key
                      )
                      for key in keys
                  ]
              )
  
          table = self._row.select(keys)
          if len(table) == 0:
              return None
  
          items = [col[0] for col in table.columns]
          try:
              # Try to interpret this as a pyarrow.Scalar value.
              return tuple([item.as_py() for item in items])
  
          except AttributeError:
              # Assume that this row is an element of an extension array, and
              # that it is bypassing pyarrow's scalar model for Arrow < 8.0.0.
              return items
  
      is_single_item = isinstance(key, str)
      keys = [key] if is_single_item else key
  
      items = get_item(keys)
  
      if items is None:
          return None
      elif is_single_item:
          return items[0]
      else:
          return items
  
imports: import collections
  import heapq
  import random
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Tuple, TypeVar, Union
  import numpy
  from ray._private.utils import _get_pyarrow_version
  from ray.air.constants import TENSOR_COLUMN_NAME
  from ray.data._internal.arrow_ops import transform_polars, transform_pyarrow
  from ray.data._internal.numpy_support import convert_udf_returns_to_numpy, is_valid_udf_return
  from ray.data._internal.table_block import TableBlockAccessor, TableBlockBuilder
  from ray.data._internal.util import _truncated_repr, 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 1 for calling the ArrowRow obj's underlying member method code with example usage: obj.__getitem__(key) and returns: None, tuple, None, tuple, items, items, items