class_docstr: A datasink that writes multiple rows to each file.
  
  Subclasses must implement ``write_block_to_file`` and call the superclass
  constructor.
  
  Examples:
      .. testcode::
  
          class CSVDatasink(BlockBasedFileDatasink):
              def __init__(self, path: str):
                  super().__init__(path, file_format="csv")
  
              def write_block_to_file(self, block: BlockAccessor, file: "pyarrow.NativeFile"):
                  from pyarrow import csv
                  csv.write_csv(block.to_arrow(), file)
docstr: Write a block of data to a file.
  
  Args:
      block: The block to write.
      file: The file to write the block to.
docstr_tok: ["Write","a","block","of","data","to","a","file",".","Args",":","block",":","The","block","to","write",".","file",":","The","file","to","write","the","block","to","."]
code: def write_block_to_file(
      self, block: BlockAccessor, file: "pyarrow.NativeFile"
  ):
      """Write a block of data to a file.
  
      Args:
          block: The block to write.
          file: The file to write the block to.
      """
      raise NotImplementedError
  
imports: import posixpath
  import warnings
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional
  from ray._private.utils import _add_creatable_buckets_param_if_s3_uri
  from ray.data._internal.dataset_logger import DatasetLogger
  from ray.data._internal.execution.interfaces import TaskContext
  from ray.data._internal.util import _is_local_scheme, call_with_retry
  from ray.data.block import Block, BlockAccessor
  from ray.data.context import DataContext
  from ray.data.datasource.block_path_provider import BlockWritePathProvider
  from ray.data.datasource.datasink import Datasink
  from ray.data.datasource.filename_provider import FilenameProvider, _DefaultFilenameProvider
  from ray.data.datasource.path_util import _resolve_paths_and_filesystem
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 1 for calling the BlockBasedFileDatasink obj's underlying member method code with example usage: obj.write_block_to_file(block, file) without return types