Skip to content

TST: Fix gbq integration tests. gbq._Dataset.dataset() would not return full results #15381

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

Closed
wants to merge 1 commit into from

Conversation

parthea
Copy link
Contributor

@parthea parthea commented Feb 13, 2017

  • [ x ] passes git diff upstream/master | flake8 --diff

This PR resolves an issue where gbq._Dataset.datasets() would not return all datasets under a Google BigQuery project.

If 'nextPageToken' is populated, then another datasets().list() request should be sent with 'pageToken' set to collect more results.

In the past few days, additional datasets were added under the Google BigQuery project id used by pandas as part of the following github project : https://github.com/pydata/pandas-gbq . The addition of datasets caused many gbq unit tests to fail because in function clean_gbq_environment(), we check to see if the dataset exists using the incomplete results from gbq._Dataset.datasets() before we attempt to delete it.

https://github.com/pandas-dev/pandas/blob/master/pandas/tests/io/test_gbq.py#L218

@parthea
Copy link
Contributor Author

parthea commented Feb 13, 2017

All gbq units tests passed on Travis on my fork : https://travis-ci.org/parthea/pandas/builds/201024038

pandas/tests/io/test_clipboard.py ssssss
pandas/tests/io/test_gbq.py sssssss............s..........................................s............s.
pandas/tests/io/test_pytables.py .......................................................s.......................................................................................

@codecov-io
Copy link

Codecov Report

Merging #15381 into master will decrease coverage by -0.01%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master   #15381      +/-   ##
==========================================
- Coverage   90.42%   90.41%   -0.01%     
==========================================
  Files         134      134              
  Lines       49357    49369      +12     
==========================================
+ Hits        44632    44638       +6     
- Misses       4725     4731       +6
Impacted Files Coverage Δ
pandas/io/gbq.py 16.46% <ø> (-0.42%)
pandas/core/common.py 91.36% <ø> (+0.33%)
pandas/util/testing.py 82.91% <ø> (+0.46%)

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 d9e75c7...61bc1e7. Read the comment docs.

@jreback
Copy link
Contributor

jreback commented Feb 14, 2017

is this need to be added to pandas-gbq?

@jreback jreback added this to the 0.20.0 milestone Feb 14, 2017
@jreback jreback added the Testing pandas testing functions or related to the test suite label Feb 14, 2017
@jreback jreback closed this in 86ca84d Feb 14, 2017
@jreback
Copy link
Contributor

jreback commented Feb 14, 2017

thanks @parthea

AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this pull request Mar 21, 2017
…rn full results

This PR resolves an issue where `gbq._Dataset.datasets()` would not return
all datasets under a Google BigQuery project.

If `'nextPageToken'` is populated, then another `datasets().list()`
request should be sent with `'pageToken'` set to collect more results.
In the past few days, additional datasets were added under the Google
BigQuery project id used by pandas as part of the following github
project : https://github.com/pydata/pandas-gbq .

The addition of datasets caused many gbq unit tests to fail because in function
`clean_gbq_environment()`, we check to see if the dataset exists using
the incomplete results from `gbq._Dataset.datasets()` before we
attempt to delete it.

Author: Anthonios Partheniou <[email protected]>

Closes pandas-dev#15381 from parthea/fix-broken-gbq-unit-tests and squashes the following commits:

61bc1e7 [Anthonios Partheniou] TST: Fix gbq tests. gbq.dataset()/gbq.tables would not return full results.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants