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: update pandas-gbq to 0.8.0, adds credentials arg #23662

Merged
merged 3 commits into from
Nov 17, 2018

Conversation

tswast
Copy link
Contributor

@tswast tswast commented Nov 13, 2018

  • N/A closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@pep8speaks
Copy link

Hello @tswast! Thanks for submitting the PR.

reauth=False, if_exists='fail', private_key=None,
auth_local_webserver=False, table_schema=None, location=None,
progress_bar=True, verbose=None):
reauth=False, if_exists='fail', auth_local_webserver=False,
Copy link
Member

Choose a reason for hiding this comment

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

I realize private_key was listed as a breaking change for pandas-gbq but don't believe it was ever deprecated on our end. Is there no other way to go about this than just removing?

Copy link
Member

Choose a reason for hiding this comment

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

Whoops sorry I see it was just moved around in the signature. Any reason for doing that? Seems like it would be safer to keep in it's current position

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 moved it to the end because that's where I was told to move verbose when we deprecated that. Seeing as there are already many keyword arguments preceding it, I don't think there's a risk of people using the position of the argument.

@codecov
Copy link

codecov bot commented Nov 13, 2018

Codecov Report

Merging #23662 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #23662   +/-   ##
=======================================
  Coverage   92.24%   92.24%           
=======================================
  Files         161      161           
  Lines       51339    51339           
=======================================
  Hits        47360    47360           
  Misses       3979     3979
Flag Coverage Δ
#multiple 90.64% <ø> (ø) ⬆️
#single 42.34% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/gbq.py 25% <ø> (ø) ⬆️
pandas/core/frame.py 97.02% <ø> (ø) ⬆️

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 b4b945a...d633cdf. Read the comment docs.

@@ -19,7 +19,7 @@
api_exceptions = pytest.importorskip("google.api_core.exceptions")
bigquery = pytest.importorskip("google.cloud.bigquery")
service_account = pytest.importorskip("google.oauth2.service_account")
pandas_gbq = pytest.importorskip('pandas_gbq')
pandas_gbq = pytest.importorskip("pandas_gbq", minversion="0.8.0")
Copy link
Contributor

Choose a reason for hiding this comment

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

no
you need to support the stated min. version

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not bump the minimum version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dropped. Now it'll error instead of skip if an old version of pandas-gbq is installed.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm where is this actually erroring?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It'll import at the call to pandas_gbq.read_gbq() or pandas_gbq.to_gbq() with a "unexpected 'credentials' argument". There are a couple of versions of pandas-gbq that used **kwargs in read_gbq(). Unfortunately, it will just ignore the extra argument in those older versions.

Copy link
Member

Choose a reason for hiding this comment

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

Do those kwargs begin at a certain version? Wondering if we shouldn't have test coverage for those to ensure behavior. Alternately could consider bumping the min version in our requirements files

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 couldn't find any explicit versions for pandas-gbq in any requirements files. https://github.com/pandas-dev/pandas/search?q=pandas-gbq&unscoped_q=pandas-gbq

kwargs for read_gbq were removed in googleapis/python-bigquery-pandas@e7007a8 which corresponds to pandas-gbq version 0.5.0. Any version before that may silently fail.

reflect changes from the `Pandas-GBQ library version 0.8.0
<https://pandas-gbq.readthedocs.io/en/latest/changelog.html#changelog-0-8-0>`__.
Adds a ``credentials`` argument, which enables the use of any kind of
`google-auth credentials
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 also add this version change in the dependencies changed section (further down). and update install.rst

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 d633cdf

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

jreback commented Nov 15, 2018

lgtm. @WillAyd over to you.

@WillAyd WillAyd merged commit 24bce1a into pandas-dev:master Nov 17, 2018
@WillAyd
Copy link
Member

WillAyd commented Nov 17, 2018

Thanks @tswast

@tswast tswast deleted the pandas-gbq-0-8-0 branch November 18, 2018 05:00
thoo added a commit to thoo/pandas that referenced this pull request Nov 19, 2018
…fixed

* upstream/master: (46 commits)
  DEPS: bump xlrd min version to 1.0.0 (pandas-dev#23774)
  BUG: Don't warn if default conflicts with dialect (pandas-dev#23775)
  BUG: Fixing memory leaks in read_csv (pandas-dev#23072)
  TST: Extend datetime64 arith tests to array classes, fix several broken cases (pandas-dev#23771)
  STYLE: Specify bare exceptions in pandas/tests (pandas-dev#23370)
  ENH: between_time, at_time accept axis parameter (pandas-dev#21799)
  PERF: Use is_utc check to improve performance of dateutil UTC in DatetimeIndex methods (pandas-dev#23772)
  CLN: io/formats/html.py: refactor (pandas-dev#22726)
  API: Make Categorical.searchsorted returns a scalar when supplied a scalar (pandas-dev#23466)
  TST: Add test case for GH14080 for overflow exception (pandas-dev#23762)
  BUG: Don't extract header names if none specified (pandas-dev#23703)
  BUG: Index.str.partition not nan-safe (pandas-dev#23558) (pandas-dev#23618)
  DEPR: tz_convert in the Timestamp constructor (pandas-dev#23621)
  PERF: Datetime/Timestamp.normalize for timezone naive datetimes (pandas-dev#23634)
  TST: Use new arithmetic fixtures, parametrize many more tests (pandas-dev#23757)
  REF/TST: Add more pytest idiom to parsers tests (pandas-dev#23761)
  DOC: Add ignore-deprecate argument to validate_docstrings.py (pandas-dev#23650)
  ENH: update pandas-gbq to 0.8.0, adds credentials arg (pandas-dev#23662)
  DOC: Improve error message to show correct order (pandas-dev#23652)
  ENH: Improve error message for empty object array (pandas-dev#23718)
  ...
tm9k1 pushed a commit to tm9k1/pandas that referenced this pull request Nov 19, 2018
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants