File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def read_gbq(
32
32
use_bqstorage_api : Optional [bool ] = None ,
33
33
private_key = None ,
34
34
verbose = None ,
35
- progress_bar_type : Optional [str ] = None ,
35
+ progress_bar_type : Optional [str ] = "NOT_SET" ,
36
36
) -> "DataFrame" :
37
37
"""
38
38
Load data from Google BigQuery.
@@ -132,6 +132,8 @@ def read_gbq(
132
132
133
133
Possible values of ``progress_bar_type`` include:
134
134
135
+ ``NOT_SET``
136
+ Arg is not set by caller, don't including the argument in pandas-gbq call.
135
137
``None``
136
138
No progress bar.
137
139
``'tqdm'``
@@ -167,8 +169,7 @@ def read_gbq(
167
169
# START: new kwargs. Don't populate unless explicitly set.
168
170
if use_bqstorage_api is not None :
169
171
kwargs ["use_bqstorage_api" ] = use_bqstorage_api
170
-
171
- if progress_bar_type is not None :
172
+ if progress_bar_type != "NOT_SET" :
172
173
kwargs ["progress_bar_type" ] = progress_bar_type
173
174
# END: new kwargs
174
175
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ def mock_read_gbq(sql, **kwargs):
131
131
assert "use_bqstorage_api" not in captured_kwargs
132
132
133
133
134
- @pytest .mark .parametrize ("progress_bar" , [None , "foo" ])
134
+ @pytest .mark .parametrize ("progress_bar" , [None , "foo" , "NOT_SET" ])
135
135
def test_read_gbq_progress_bar_type_kwarg (monkeypatch , progress_bar ):
136
136
# GH 29857
137
137
captured_kwargs = {}
@@ -142,11 +142,10 @@ def mock_read_gbq(sql, **kwargs):
142
142
143
143
monkeypatch .setattr ("pandas_gbq.read_gbq" , mock_read_gbq )
144
144
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 :
145
+ if progress_bar == "NOT_SET" :
149
146
assert "progress_bar_type" not in captured_kwargs
147
+ else :
148
+ assert "progress_bar_type" in captured_kwargs
150
149
151
150
152
151
@pytest .mark .single
You can’t perform that action at this time.
0 commit comments