code: def bigquery_get_data(
      logger: Logger,
      dataset_id: str | None,
      table_id: str | None,
      big_query_hook: BigQueryHook,
      batch_size: int,
      selected_fields: list[str] | str | None,
  ) -> Iterator:
      logger.info("Fetching Data from:")
      logger.info("Dataset: %s ; Table: %s", dataset_id, table_id)
  
      for start_index in itertools.count(step=batch_size):
          rows: list[Row] | RowIterator = big_query_hook.list_rows(
              dataset_id=dataset_id,
              table_id=table_id,
              max_results=batch_size,
              selected_fields=selected_fields,
              start_index=start_index,
          )
  
          if isinstance(rows, RowIterator):
              raise TypeError(
                  "BigQueryHook.list_rows() returns iterator when return_iterator=False (default)"
              )
  
          if len(rows) == 0:
              logger.info("Job Finished")
              return
  
          logger.info(
              "Total Extracted rows: %s", len(rows) + start_index
          )
  
          yield [row.values() for row in rows]
  
imports: from __future__ import annotations
  import itertools
  from typing import TYPE_CHECKING
  from google.cloud.bigquery.table import Row, RowIterator
label_desc: Use image node_id 1 for calling a global function with example usage: bigquery_get_data(logger, dataset_id, table_id, big_query_hook, batch_size, selected_fields) without return types