class_docstr: A list of blocks that may be computed or pending computation.
  
  In the basic version of BlockList, all blocks are known ahead of time. In
  LazyBlockList, blocks are not yet computed, so the number of blocks may
  change after execution due to block splitting.
class_docstr_tok: ["A","list","of","blocks","that","may","be","computed","or","pending","computation",".","In","the","basic","version","of","BlockList",",","all","blocks","are","known","ahead","of","time",".","In","LazyBlockList",",","blocks","are","not","yet","computed",",","so","the","number","of","blocks","may","change","after","execution","due","to","block","splitting","."]
docstr: Truncate the block list to the minimum number of blocks that contains at
  least limit rows.
  
  If the number of rows is not available, it will be treated as a 0-row block and
  will be included in the truncated output.
docstr_tok: ["Truncate","the","block","list","to","the","minimum","number","of","blocks","that","contains","at","least","limit","rows",".","If","the","number","of","rows","is","not","available",",","it","will","be","treated","as","a","0-row","block","and","will","be","included","in","the","truncated","output","."]
code: def truncate_by_rows(self, limit: int) -> "BlockList":
      """Truncate the block list to the minimum number of blocks that contains at
      least limit rows.
  
      If the number of rows is not available, it will be treated as a 0-row block and
      will be included in the truncated output.
      """
      self._check_if_cleared()
      out_blocks = []
      out_meta = []
      out_num_rows = 0
      for b, m in self.iter_blocks_with_metadata():
          num_rows = m.num_rows
          if num_rows is None:
              num_rows = 0
          out_blocks.append(b)
          out_meta.append(m)
          out_num_rows += num_rows
          if out_num_rows >= limit:
              break
      return BlockList(
          out_blocks,
          out_meta,
          owned_by_consumer=self._owned_by_consumer,
      )
  
imports: import math
  from typing import Iterator, List, Optional, Tuple
  import numpy
  from ray.data._internal.memory_tracing import trace_allocation
  from ray.data.block import Block, BlockMetadata
  from ray.types import ObjectRef
label_desc: Use image node_id 10 for calling the BlockList obj's underlying member method code with example usage: obj.truncate_by_rows(limit) and returns: BlockList