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

BigQuery: Treat NaN as NULL when converting from pandas to arrow. #8785

Merged
merged 2 commits into from
Jul 25, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Treat NaN as NULL when converting from pandas to arrow.
Fixes broken unit tests from latest pyarrow release.
  • Loading branch information
tswast committed Jul 25, 2019
commit 1ae14b64ad993ef677646c21e02148fbf2e68a8c
5 changes: 4 additions & 1 deletion bigquery/tests/unit/test__pandas_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,10 @@ def test_bq_to_arrow_array_w_special_floats(module_under_test):
roundtrip = arrow_array.to_pylist()
assert len(rows) == len(roundtrip)
assert roundtrip[0] == float("-inf")
assert roundtrip[1] != roundtrip[1] # NaN doesn't equal itself.
# Since we are converting from pandas, NaN is treated as NULL in pyarrow
# due to pandas conventions.
# https://arrow.apache.org/docs/python/data.html#none-values-and-nan-handling
assert roundtrip[1] is None
assert roundtrip[2] == float("inf")
assert roundtrip[3] is None

Expand Down