class_docstr: Interface for defining write-related logic.
  
  If you want to write data to something that isn't built-in, subclass this class
  and call :meth:`~ray.data.Dataset.write_datasink`.
class_docstr_tok: ["Interface","for","defining","write-related","logic",".","If","you","want","to","write","data","to","something","that","is","n't","built-in",",","subclass","this","class","and","call",":","meth",":","`","~ray.data.Dataset.write_datasink","`","."]
docstr: Write blocks. This is used by a single write task.
  
  Args:
      blocks: Generator of data blocks.
      ctx: ``TaskContext`` for the write task.
  
  Returns:
      A user-defined output. Can be anything, and the returned value is passed to
      :meth:`~Datasink.on_write_complete`.
docstr_tok: ["Write","blocks",".","This","is","used","by","a","single","write","task",".","Args",":","blocks",":","Generator","of","data","blocks",".","ctx",":","``","TaskContext","``","for","the","write","task",".","Returns",":","A","user-defined","output",".","Can","be","anything",",","and","the","returned","value","is","passed","to",":","meth",":","`","~Datasink.on_write_complete","`","."]
code: def write(
      self,
      blocks: Iterable[Block],
      ctx: TaskContext,
  ) -> Any:
      """Write blocks. This is used by a single write task.
  
      Args:
          blocks: Generator of data blocks.
          ctx: ``TaskContext`` for the write task.
  
      Returns:
          A user-defined output. Can be anything, and the returned value is passed to
          :meth:`~Datasink.on_write_complete`.
      """
      raise NotImplementedError
  
file_path: ray/python/ray/data/datasource/datasink.py
imports: from typing import Any, Iterable, List
  from ray.data._internal.execution.interfaces import TaskContext
  from ray.data.block import Block
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 2 for calling the Datasink obj's underlying member method code with example usage: obj.write(blocks, ctx) without return types