Skip to content
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

Merged
merged 1 commit into from
Sep 18, 2018

Conversation

tswast
Copy link
Contributor

@tswast tswast commented Aug 31, 2018

@tswast tswast changed the title [ENH] pull in warning for dialect change from pandas-gbq. [ENH] pull in warning for dialect change from pandas-gbq Aug 31, 2018
@codecov
Copy link

codecov bot commented Aug 31, 2018

Codecov Report

Merging #22557 into master will decrease coverage by 0.13%.
The diff coverage is 25%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#multiple 90.44% <25%> (-0.14%) ⬇️
#single 42.29% <25%> (-0.06%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 25% <25%> (ø) ⬆️
pandas/errors/__init__.py 92.3% <0%> (-7.7%) ⬇️
pandas/core/dtypes/base.py 92.68% <0%> (-7.32%) ⬇️
pandas/core/arrays/base.py 88% <0%> (-6.25%) ⬇️
pandas/io/html.py 89.17% <0%> (-2.08%) ⬇️
pandas/io/formats/html.py 88.81% <0%> (-1.87%) ⬇️
pandas/core/arrays/datetimelike.py 94.02% <0%> (-1.75%) ⬇️
pandas/core/arrays/datetimes.py 95.52% <0%> (-1.3%) ⬇️
pandas/io/parquet.py 71.79% <0%> (-1.25%) ⬇️
pandas/core/base.py 96.92% <0%> (-0.69%) ⬇️
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73dd6ec...0de8d22. Read the comment docs.

@gfyoung gfyoung added Error Reporting Incorrect or improved errors from pandas Compat pandas objects compatability with Numpy or Python functions labels Sep 1, 2018
FutureWarning,
stacklevel=2,
)

Copy link
Member

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?

Copy link
Contributor Author

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:

https://github.com/pydata/pandas-gbq/blob/998b6cfe953613bf5ada6253a7d3550837a2d169/tests/unit/test_gbq.py#L367-L369

I suppose I should include a similar test here?

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 07c2eb8

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):
Copy link
Contributor

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)

Copy link
Contributor Author

@tswast tswast Sep 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 0de8d22

@@ -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()
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 0de8d22

@pep8speaks
Copy link

Hello @tswast! Thanks for updating the PR.

@tswast
Copy link
Contributor Author

tswast commented Sep 13, 2018

Travis error appears to be a temporary issue with Conda downloads. https://travis-ci.org/pandas-dev/pandas/jobs/427334975

CondaHTTPError: HTTP 504 GATEWAY TIME-OUT for url https://conda.anaconda.org/conda-forge/linux-64/pycryptodome-3.6.6-py27h16a7912_0.tar.bz2

Maybe retrying it would help?

@jreback jreback added this to the 0.24.0 milestone Sep 15, 2018
Copy link
Contributor

@jreback jreback left a 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.
Copy link
Contributor

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.
@jreback jreback merged commit 1542d29 into pandas-dev:master Sep 18, 2018
@jreback
Copy link
Contributor

jreback commented Sep 18, 2018

thanks @tswast

aeltanawy pushed a commit to aeltanawy/pandas that referenced this pull request Sep 20, 2018
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
@tswast tswast mentioned this pull request Oct 24, 2018
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants