-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
[ENH] pull in warning for dialect change from pandas-gbq #22557
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22557 +/- ##
==========================================
- Coverage 92.17% 92.03% -0.14%
==========================================
Files 169 169
Lines 50708 50791 +83
==========================================
+ Hits 46740 46746 +6
- Misses 3968 4045 +77
Continue to review full report at Codecov.
|
FutureWarning, | ||
stacklevel=2, | ||
) | ||
|
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.
Do we have a good way to test this by any chance?
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.
I've got a test in the pandas-gbq repo:
I suppose I should include a similar test here?
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.
If it's possible to include in some shape or form, I would definitely be 👍 for it.
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.
Added in 07c2eb8
pandas/tests/io/test_gbq.py
Outdated
mock_read_gbq = mock.Mock() | ||
mock_read_gbq.return_value = DataFrame([[1.0]]) | ||
monkeypatch.setattr(pandas_gbq, 'read_gbq', mock_read_gbq) | ||
with pytest.warns(FutureWarning): |
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.
use tm.assert_produces_warning, we don't use pytest.warns
(and it fails our linter)
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.
Done in 0de8d22
pandas/tests/io/test_gbq.py
Outdated
@@ -93,6 +98,14 @@ def make_mixed_dataframe_v2(test_size): | |||
index=range(test_size)) | |||
|
|||
|
|||
def test_read_gbq_without_dialect_warns_future_change(monkeypatch): | |||
mock_read_gbq = mock.Mock() |
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.
can you add the issue number as a comment here
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.
Done in 0de8d22
Hello @tswast! Thanks for updating the PR.
|
Travis error appears to be a temporary issue with Conda downloads. https://travis-ci.org/pandas-dev/pandas/jobs/427334975
Maybe retrying it would help? |
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.
tiny comment. ping on green.
@@ -65,6 +67,8 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None, | |||
|
|||
*New in version 0.2.0 of pandas-gbq*. | |||
dialect : str, default 'legacy' | |||
Note: The default value is changing to 'standard' in a future verion. |
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.
can you add a versionchanged (0.24.0)
* Add comment linking to pandas-gbq issue for change in default dialect. * Add versionchanged to read_gbq dialect.
thanks @tswast |
closestowards Make Standard SQL Default googleapis/python-bigquery-pandas#195git diff upstream/master -u -- "*.py" | flake8 --diff