python/ray/data/impl/block_list.py
def split_by_bytes(self, bytes_per_split: int) -> List["BlockList"]:
        """Split this BlockList into multiple lists.

        Args:
            bytes_per_split: The max number of bytes per split.
        """
        self._check_if_cleared()
        output = []
        cur_blocks = []
        cur_meta = []
        cur_size = 0
        for b, m in zip(self._blocks, self._metadata):
            if m.size_bytes is None:
                raise RuntimeError(
                    "Block has unknown size, cannot use split_by_bytes()"
                )
            size = m.size_bytes
            if cur_blocks and cur_size + size > bytes_per_split:
                output.append(BlockList(cur_blocks, cur_meta))
                cur_blocks = []
                cur_meta = []
                cur_size = 0
            cur_blocks.append(b)
            cur_meta.append(m)
            cur_size += size
        if cur_blocks:
            output.append(BlockList(cur_blocks, cur_meta))
        return output
Split this BlockList into multiple lists.

        Args:
            bytes_per_split: The max number of bytes per split.
        
Split this BlockList into multiple lists.
Split this BlockList into multiple lists .
def split_by_bytes(self, bytes_per_split: int) -> List["BlockList"]:
        self._check_if_cleared()
        output = []
        cur_blocks = []
        cur_meta = []
        cur_size = 0
        for b, m in zip(self._blocks, self._metadata):
            if m.size_bytes is None:
                raise RuntimeError(
                    "Block has unknown size, cannot use split_by_bytes()"
                )
            size = m.size_bytes
            if cur_blocks and cur_size + size > bytes_per_split:
                output.append(BlockList(cur_blocks, cur_meta))
                cur_blocks = []
                cur_meta = []
                cur_size = 0
            cur_blocks.append(b)
            cur_meta.append(m)
            cur_size += size
        if cur_blocks:
            output.append(BlockList(cur_blocks, cur_meta))
        return output
def split_by_bytes ( self , bytes_per_split : int ) -> List [ "BlockList" ] : self . _check_if_cleared ( ) output = [ ] cur_blocks = [ ] cur_meta = [ ] cur_size = 0 for b , m in zip ( self . _blocks , self . _metadata ) : if m . size_bytes is None : raise RuntimeError ( "Block has unknown size, cannot use split_by_bytes()" ) size = m . size_bytes if cur_blocks and cur_size + size > bytes_per_split : output . append ( BlockList ( cur_blocks , cur_meta ) ) cur_blocks = [ ] cur_meta = [ ] cur_size = 0 cur_blocks . append ( b ) cur_meta . append ( m ) cur_size += size if cur_blocks : output . append ( BlockList ( cur_blocks , cur_meta ) ) return output
Split this BlockList into multiple lists.
Split this BlockList into multiple lists .
"""Split this BlockList into multiple lists.

        Args:
            bytes_per_split: The max number of bytes per split.
        """
self
bytes_per_split
int
The max number of bytes per split.
The max number of bytes per split .