Skip to content

Commit 34edd52

Browse files
authored
Send None parameter to pandas-gbq to set no progress bar (#33477)
1 parent 035e1fe commit 34edd52

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

ci/deps/travis-36-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies:
2727
- numexpr
2828
- numpy
2929
- openpyxl
30-
- pandas-gbq=0.8.0
30+
- pandas-gbq=0.12.0
3131
- psycopg2=2.6.2
3232
- pymysql=0.7.11
3333
- pytables

doc/source/getting_started/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ lxml 3.8.0 HTML parser for read_html (see :ref
274274
matplotlib 2.2.2 Visualization
275275
numba 0.46.0 Alternative execution engine for rolling operations
276276
openpyxl 2.5.7 Reading / writing for xlsx files
277-
pandas-gbq 0.8.0 Google Big Query access
277+
pandas-gbq 0.12.0 Google Big Query access
278278
psycopg2 PostgreSQL engine for sqlalchemy
279279
pyarrow 0.12.0 Parquet, ORC (requires 0.13.0), and feather reading / writing
280280
pymysql 0.7.11 MySQL engine for sqlalchemy

doc/source/whatsnew/v1.1.0.rst

+3
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ Other enhancements
289289
- Make :class:`pandas.core.window.Rolling` and :class:`pandas.core.window.Expanding` iterable(:issue:`11704`)
290290
- Make ``option_context`` a :class:`contextlib.ContextDecorator`, which allows it to be used as a decorator over an entire function (:issue:`34253`).
291291
- :meth:`groupby.transform` now allows ``func`` to be ``pad``, ``backfill`` and ``cumcount`` (:issue:`31269`).
292+
- :meth `~pandas.io.gbq.read_gbq` now allows to disable progress bar (:issue:`33360`).
292293

293294
.. ---------------------------------------------------------------------------
294295
@@ -355,6 +356,8 @@ Optional libraries below the lowest tested version may still work, but are not c
355356
+-----------------+-----------------+---------+
356357
| xlwt | 1.2.0 | |
357358
+-----------------+-----------------+---------+
359+
| pandas-gbq | 1.2.0 | X |
360+
+-----------------+-----------------+---------+
358361

359362
See :ref:`install.dependencies` and :ref:`install.optional_dependencies` for more.
360363

pandas/compat/_optional.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"numexpr": "2.6.2",
1616
"odfpy": "1.3.0",
1717
"openpyxl": "2.5.7",
18-
"pandas_gbq": "0.8.0",
18+
"pandas_gbq": "0.12.0",
1919
"pyarrow": "0.13.0",
2020
"pytables": "3.4.3",
2121
"pytest": "5.0.1",

pandas/io/gbq.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,13 @@ def read_gbq(
162162
"""
163163
pandas_gbq = _try_import()
164164

165-
kwargs: Dict[str, Union[str, bool]] = {}
165+
kwargs: Dict[str, Union[str, bool, None]] = {}
166166

167167
# START: new kwargs. Don't populate unless explicitly set.
168168
if use_bqstorage_api is not None:
169169
kwargs["use_bqstorage_api"] = use_bqstorage_api
170170

171-
if progress_bar_type is not None:
172-
kwargs["progress_bar_type"] = progress_bar_type
171+
kwargs["progress_bar_type"] = progress_bar_type
173172
# END: new kwargs
174173

175174
return pandas_gbq.read_gbq(

pandas/tests/io/test_gbq.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,7 @@ def mock_read_gbq(sql, **kwargs):
142142

143143
monkeypatch.setattr("pandas_gbq.read_gbq", mock_read_gbq)
144144
pd.read_gbq("SELECT 1", progress_bar_type=progress_bar)
145-
146-
if progress_bar:
147-
assert "progress_bar_type" in captured_kwargs
148-
else:
149-
assert "progress_bar_type" not in captured_kwargs
145+
assert "progress_bar_type" in captured_kwargs
150146

151147

152148
@pytest.mark.single

0 commit comments

Comments
 (0)