Skip to content

Commit 21ca375

Browse files
committed
chore: add callback argument to _read_gbq_colab
1 parent df24c84 commit 21ca375

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

bigframes/session/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import typing
2525
from typing import (
2626
Any,
27-
Callable,
2827
Dict,
2928
IO,
3029
Iterable,
@@ -504,6 +503,9 @@ def _read_gbq_colab(
504503
*,
505504
pyformat_args: Optional[Dict[str, Any]] = None,
506505
dry_run: bool = False,
506+
callback: abc.Callable[
507+
[Any], None
508+
] = lambda _: None, # TODO: use an Event class not Any.
507509
) -> Union[dataframe.DataFrame, pandas.Series]:
508510
"""A version of read_gbq that has the necessary default values for use in colab integrations.
509511
@@ -535,6 +537,7 @@ def _read_gbq_colab(
535537
index_col=bigframes.enums.DefaultIndexKind.NULL,
536538
force_total_order=False,
537539
dry_run=typing.cast(Union[Literal[False], Literal[True]], dry_run),
540+
callback=callback,
538541
)
539542

540543
@overload
@@ -992,7 +995,7 @@ def read_csv(
992995
pandas.Series,
993996
pandas.Index,
994997
np.ndarray[Any, Any],
995-
Callable[[Any], bool],
998+
abc.Callable[[Any], bool],
996999
]
9971000
] = None,
9981001
dtype: Optional[Dict] = None,

bigframes/session/loader.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from __future__ import annotations
1616

17+
from collections import abc
1718
import copy
1819
import dataclasses
1920
import datetime
@@ -22,6 +23,7 @@
2223
import os
2324
import typing
2425
from typing import (
26+
Any,
2527
Dict,
2628
Generator,
2729
Hashable,
@@ -743,6 +745,9 @@ def read_gbq_query(
743745
filters: third_party_pandas_gbq.FiltersType = (),
744746
dry_run: bool = False,
745747
force_total_order: Optional[bool] = None,
748+
callback: abc.Callable[
749+
[Any], None
750+
] = lambda _: None, # TODO: use an Event class not Any.
746751
) -> dataframe.DataFrame | pandas.Series:
747752
import bigframes.dataframe as dataframe
748753

0 commit comments

Comments
 (0)