Skip to content

Commit

Permalink
Actually use the progress_bar_type argument in QueryJob.to_dataframe()
Browse files Browse the repository at this point in the history
  • Loading branch information
tswast committed Mar 29, 2019
1 parent 8942439 commit e0dff69
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion bigquery/google/cloud/bigquery/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -2857,7 +2857,9 @@ def to_dataframe(self, bqstorage_client=None, dtypes=None, progress_bar_type=Non
ValueError: If the `pandas` library cannot be imported.
"""
return self.result().to_dataframe(
bqstorage_client=bqstorage_client, dtypes=dtypes
bqstorage_client=bqstorage_client,
dtypes=dtypes,
progress_bar_type=progress_bar_type,
)

def __iter__(self):
Expand Down
8 changes: 4 additions & 4 deletions bigquery/google/cloud/bigquery/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1422,9 +1422,7 @@ def _get_progress_bar(self, progress_bar_type):
desc=description, total=self.total_rows, unit=unit
)
elif progress_bar_type == "tqdm_gui":
return tqdm.tqdm_gui(
desc=description, total=self.total_rows, unit=unit
)
return tqdm.tqdm_gui(desc=description, total=self.total_rows, unit=unit)
except (KeyError, TypeError):
# Protect ourselves from any tqdm errors. In case of
# unexpected tqdm behavior, just fall back to showing
Expand Down Expand Up @@ -1515,14 +1513,16 @@ class _EmptyRowIterator(object):
pages = ()
total_rows = 0

def to_dataframe(self, bqstorage_client=None, dtypes=None):
def to_dataframe(self, bqstorage_client=None, dtypes=None, progress_bar_type=None):
"""Create an empty dataframe.
Args:
bqstorage_client (Any):
Ignored. Added for compatibility with RowIterator.
dtypes (Any):
Ignored. Added for compatibility with RowIterator.
progress_bar_type (Any):
Ignored. Added for compatibility with RowIterator.
Returns:
pandas.DataFrame:
Expand Down

0 comments on commit e0dff69

Please sign in to comment.