-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Add progress_bar_type argument in read_gbq #29858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7e461a1
1314059
8bcb313
2eafb1e
642281d
db72514
ef2960d
87f5e51
e184305
2d35bdd
1464b59
01207a8
9020a06
2ff5903
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,6 +144,24 @@ def mock_read_gbq(sql, **kwargs): | |
assert "use_bqstorage_api" not in captured_kwargs | ||
|
||
|
||
@pytest.mark.parametrize("progress_bar", [None, "foo"]) | ||
def test_read_gbq_progress_bar_type_kwarg(monkeypatch, progress_bar): | ||
# GH 29857 | ||
captured_kwargs = {} | ||
|
||
def mock_read_gbq(sql, **kwargs): | ||
captured_kwargs.update(kwargs) | ||
return DataFrame([[1.0]]) | ||
|
||
monkeypatch.setattr("pandas_gbq.read_gbq", mock_read_gbq) | ||
pd.read_gbq("SELECT 1", progress_bar_type=progress_bar) | ||
|
||
if progress_bar: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this test be simplified to just call with the argument? Some of the monkey patching seems to be testing non-pandas behavior There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is ok, its the same type of test we use for other kwargs |
||
assert "progress_bar_type" in captured_kwargs | ||
else: | ||
assert "progress_bar_type" not in captured_kwargs | ||
|
||
|
||
@pytest.mark.single | ||
class TestToGBQIntegrationWithServiceAccountKeyPath: | ||
@classmethod | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might as well put what you have in the doc as an annotation