43
43
import pandas as pd
44
44
import polars as pl
45
45
import pyarrow as pa
46
+ from google .cloud .bigquery .table import RowIterator
46
47
47
48
48
49
SCOPES = ["https://www.googleapis.com/auth/bigquery" ]
@@ -666,7 +667,7 @@ def _get_schema_using_query(self, query: str) -> sch.Schema:
666
667
)
667
668
return BigQuerySchema .to_ibis (job .schema )
668
669
669
- def raw_sql (self , query : str , params = None , page_size : int | None = None ) :
670
+ def raw_sql (self , query : str , params = None ) -> RowIterator :
670
671
query_parameters = [
671
672
bigquery_param (param .type (), value , param .get_name ())
672
673
for param , value in (params or {}).items ()
@@ -676,10 +677,7 @@ def raw_sql(self, query: str, params=None, page_size: int | None = None):
676
677
677
678
job_config = bq .job .QueryJobConfig (query_parameters = query_parameters or [])
678
679
return self .client .query_and_wait (
679
- query ,
680
- job_config = job_config ,
681
- project = self .billing_project ,
682
- page_size = page_size ,
680
+ query , job_config = job_config , project = self .billing_project
683
681
)
684
682
685
683
@property
@@ -770,14 +768,13 @@ def _to_query(
770
768
* ,
771
769
params : Mapping [ir .Scalar , Any ] | None = None ,
772
770
limit : int | str | None = None ,
773
- page_size : int | None = None ,
774
771
** kwargs : Any ,
775
- ):
772
+ ) -> RowIterator :
776
773
self ._run_pre_execute_hooks (table_expr )
777
774
sql = self .compile (table_expr , limit = limit , params = params , ** kwargs )
778
775
self ._log (sql )
779
776
780
- return self .raw_sql (sql , params = params , page_size = page_size )
777
+ return self .raw_sql (sql , params = params )
781
778
782
779
def to_pyarrow (
783
780
self ,
@@ -816,9 +813,7 @@ def to_pyarrow_batches(
816
813
schema = table_expr .schema () - ibis .schema ({"_TABLE_SUFFIX" : "string" })
817
814
colnames = list (schema .names )
818
815
819
- query = self ._to_query (
820
- table_expr , params = params , limit = limit , page_size = chunk_size , ** kwargs
821
- )
816
+ query = self ._to_query (table_expr , params = params , limit = limit , ** kwargs )
822
817
batch_iter = query .to_arrow_iterable (bqstorage_client = self .storage_client )
823
818
return pa .ipc .RecordBatchReader .from_batches (
824
819
schema .to_pyarrow (),
0 commit comments