class_docstr: A group of data block references and their metadata.
  
  Operators take in and produce streams of RefBundles.
  
  Most commonly a RefBundle consists of a single block object reference.
  In some cases, e.g., due to block splitting, or for a reduce task, there may
  be more than one block.
  
  Block bundles have ownership semantics, i.e., shared ownership (similar to C++
  shared_ptr, multiple operators share the same block bundle), or unique ownership
  (similar to C++ unique_ptr, only one operator owns the block bundle). This
  allows operators to know whether they can destroy blocks when they don't need
  them. Destroying blocks eagerly is more efficient than waiting for Python GC /
  Ray reference counting to kick in.
class_docstr_tok: ["A","group","of","data","block","references","and","their","metadata",".","Operators","take","in","and","produce","streams","of","RefBundles",".","Most","commonly","a","RefBundle","consists","of","a","single","block","object","reference",".","In","some","cases",",","e.g.",",","due","to","block","splitting",",","or","for","a","reduce","task",",","there","may","be","more","than","one","block",".","Block","bundles","have","ownership","semantics",",","i.e.",",","shared","ownership","(","similar","to","C++","shared_ptr",",","multiple","operators","share","the","same","block","bundle",")",",","or","unique","ownership","(","similar","to","C++","unique_ptr",",","only","one","operator","owns","the","block","bundle",")",".","This","allows","operators","to","know","whether","they","can","destroy","blocks","when","they","do","n't","need","them",".","Destroying","blocks","eagerly","is","more","efficient","than","waiting","for","Python","GC","\/","Ray","reference","counting","to","kick","in","."]
docstr: Number of rows present in this bundle, if known.
docstr_tok: ["Number","of","rows","present","in","this","bundle",",","if","known","."]
code: def num_rows(self) -> Optional[int]:
      """Number of rows present in this bundle, if known."""
      total = 0
      for b in self.blocks:
          if b[1].num_rows is None:
              return None
          else:
              total += b[1].num_rows
      return total
  
file_path: ray/python/ray/data/_internal/execution/interfaces/ref_bundle.py
imports: from dataclasses import dataclass
  from typing import Optional, Tuple
  import ray
  from .common import NodeIdStr
  from ray.data._internal.memory_tracing import trace_deallocation
  from ray.data.block import Block, BlockMetadata
  from ray.data.context import DataContext
  from ray.types import ObjectRef
label_desc: Use image node_id 3 for calling the RefBundle obj's underlying member method code with example usage: obj.num_rows() and returns: total, None