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
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion bigquery/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def default(session):
for local_dep in LOCAL_DEPS:
session.install("-e", local_dep)

# Pyarrow does not support Python 3.7
dev_install = ".[all]"
session.install("-e", dev_install)

Expand Down
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