Skip to content

Commit e0dff69

Browse files
committed
Actually use the progress_bar_type argument in QueryJob.to_dataframe()
1 parent 8942439 commit e0dff69

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎bigquery/google/cloud/bigquery/job.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2857,7 +2857,9 @@ def to_dataframe(self, bqstorage_client=None, dtypes=None, progress_bar_type=Non
28572857
ValueError: If the `pandas` library cannot be imported.
28582858
"""
28592859
return self.result().to_dataframe(
2860-
bqstorage_client=bqstorage_client, dtypes=dtypes
2860+
bqstorage_client=bqstorage_client,
2861+
dtypes=dtypes,
2862+
progress_bar_type=progress_bar_type,
28612863
)
28622864

28632865
def __iter__(self):

‎bigquery/google/cloud/bigquery/table.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,9 +1422,7 @@ def _get_progress_bar(self, progress_bar_type):
14221422
desc=description, total=self.total_rows, unit=unit
14231423
)
14241424
elif progress_bar_type == "tqdm_gui":
1425-
return tqdm.tqdm_gui(
1426-
desc=description, total=self.total_rows, unit=unit
1427-
)
1425+
return tqdm.tqdm_gui(desc=description, total=self.total_rows, unit=unit)
14281426
except (KeyError, TypeError):
14291427
# Protect ourselves from any tqdm errors. In case of
14301428
# unexpected tqdm behavior, just fall back to showing
@@ -1515,14 +1513,16 @@ class _EmptyRowIterator(object):
15151513
pages = ()
15161514
total_rows = 0
15171515

1518-
def to_dataframe(self, bqstorage_client=None, dtypes=None):
1516+
def to_dataframe(self, bqstorage_client=None, dtypes=None, progress_bar_type=None):
15191517
"""Create an empty dataframe.
15201518
15211519
Args:
15221520
bqstorage_client (Any):
15231521
Ignored. Added for compatibility with RowIterator.
15241522
dtypes (Any):
15251523
Ignored. Added for compatibility with RowIterator.
1524+
progress_bar_type (Any):
1525+
Ignored. Added for compatibility with RowIterator.
15261526
15271527
Returns:
15281528
pandas.DataFrame:

0 commit comments

Comments
 (0)