code: def on_write_start(self) -> None:
      from google.api_core import exceptions
      from google.cloud import bigquery
  
      if self.project_id is None or self.dataset is None:
          raise ValueError("project_id and dataset are required args")
  
      # Set up datasets to write
      client = bigquery.Client(project=self.project_id)
      dataset_id = self.dataset.split(".", 1)[0]
      try:
          client.get_dataset(dataset_id)
          logger.info(
              f"Dataset {dataset_id} already exists. "
              "The table will be overwritten if it already exists."
          )
      except exceptions.NotFound:
          client.create_dataset(
              f"{self.project_id}.{dataset_id}", timeout=30
          )
          logger.info("Created dataset " + dataset_id)
  
      # Delete table if it already exists
      client.delete_table(
          f"{self.project_id}.{self.dataset}", not_found_ok=True
      )
  
file_path: ray/python/ray/data/datasource/bigquery_datasink.py
imports: import logging
  import os
  import tempfile
  import time
  import uuid
  from typing import Any, Iterable
  import pyarrow.parquet
  from ray.data._internal.execution.interfaces import TaskContext
  from ray.data._internal.remote_fn import cached_remote_fn
  from ray.data._internal.util import _check_import
  from ray.data.block import Block, BlockAccessor
  from ray.data.datasource.datasink import Datasink
label_desc: Use image node_id 2 for calling the _BigQueryDatasink obj's underlying member method code with example usage: obj.on_write_start() without return types