Skip to content

Conversation

@jasonqng
Copy link
Contributor

This PR resolves the bug documented here: #123

Basically, the custom dtype handling we have to convert missing values to NaNs fails when the field in BigQuery is an array (that is, in repeated mode). We simply set the dtype to an object if it is an array.

Added a test to check for this in the future. All previous tests still pass. Can also verify the bug and that this fixes by running:

gbq.read_gbq("select [1.1,2.2,3.3]","project",dialect="standard")

@tswast @MtDersvan

@codecov-io
Copy link

codecov-io commented Feb 21, 2018

Codecov Report

Merging #134 into master will decrease coverage by 44.84%.
The diff coverage is 25%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #134       +/-   ##
===========================================
- Coverage   75.83%   30.98%   -44.85%     
===========================================
  Files           8        8               
  Lines        1626     1630        +4     
===========================================
- Hits         1233      505      -728     
- Misses        393     1125      +732
Impacted Files Coverage Δ
pandas_gbq/gbq.py 20.56% <ø> (-56.24%) ⬇️
pandas_gbq/tests/test_gbq.py 26.88% <25%> (-56.77%) ⬇️
pandas_gbq/_load.py 62.5% <0%> (-35%) ⬇️

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 5666e6d...84582b6. Read the comment docs.

Copy link
Collaborator

@tswast tswast left a comment

Choose a reason for hiding this comment

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

Thanks!

Mind linking to a Travis build with the system tests passing before I merge it?

@tswast
Copy link
Collaborator

tswast commented Feb 22, 2018

Oh, and mind adding an entry to the changelog? This would be for version 0.3.2 / [TBD]

@jasonqng
Copy link
Contributor Author

jasonqng commented Feb 22, 2018

@tswast Hm, most of the tests were skipped, was there something I was supposed to do? https://travis-ci.org/jasonqng/pandas-gbq/builds/345048014 Nm, I see: https://pandas-gbq.readthedocs.io/en/latest/contributing.html#contributing-to-the-code-base Will comment again once I've gotten set up with my creds

Pytest runs on my local and everything passes here.

@jasonqng
Copy link
Contributor Author

@tswast All tests pass: https://travis-ci.org/jasonqng/pandas-gbq/builds/345048014

@tswast tswast merged commit f2f2112 into googleapis:master Feb 23, 2018
@jasonqng jasonqng deleted the handle-float-arrays branch April 6, 2018 03:32
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.

3 participants