code: def _get_num_rows(self) -> int:
      with _connect(self.connection_factory) as cursor:
          cursor.execute(f"SELECT COUNT(*) FROM ({self.sql}) as T")
          return cursor.fetchone()[0]
  
file_path: ray/python/ray/data/datasource/sql_datasource.py
imports: import math
  from contextlib import contextmanager
  from typing import Any, Callable, Iterable, Iterator, List, Optional
  from ray.data.block import Block, BlockAccessor, BlockMetadata
  from ray.data.datasource.datasource import Datasource, ReadTask
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 4 for calling the SQLDatasource obj's underlying member method code with example usage: obj._get_num_rows() and returns: cursor