Skip to content
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
4 changes: 2 additions & 2 deletions packages/bigframes/bigframes/session/_io/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def arrow_to_pandas(
# Preserve NA/NaN distinction. Note: This is currently needed, even if we use
# nullable Float64Dtype in the types_mapper. See:
# https://github.com/pandas-dev/pandas/issues/55668
mask = pyarrow.compute.is_null(column)
mask = pyarrow.compute.is_null(column) # type: ignore[attr-defined]
Comment thread
chalmerlowe marked this conversation as resolved.
nonnull = pyarrow.compute.fill_null(column, float("nan"))
# Regarding type: ignore, this class has been public at this
# location since pandas 1.2.0. See:
Expand All @@ -106,7 +106,7 @@ def arrow_to_pandas(
elif dtype == pandas.Int64Dtype():
# Avoid out-of-bounds errors in Pandas 1.5.x, which incorrectly
# casts to float64 in an intermediate step.
mask = pyarrow.compute.is_null(column)
mask = pyarrow.compute.is_null(column) # type: ignore[attr-defined]
Comment thread
chalmerlowe marked this conversation as resolved.
nonnull = pyarrow.compute.fill_null(column, 0)
pd_array = pandas.arrays.IntegerArray(
nonnull.to_numpy()
Expand Down
4 changes: 2 additions & 2 deletions packages/bigframes/tests/system/small/bigquery/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def test_to_json_from_struct():

actual = bbq.to_json(s)
expected = bpd.Series(
['{"project":"pandas","version":1}', '{"project":"numpy","version":2}'],
['{"version":1,"project":"pandas"}', '{"version":2,"project":"numpy"}'],
Comment thread
chalmerlowe marked this conversation as resolved.
dtype=dtypes.JSON_DTYPE,
)

Expand All @@ -429,7 +429,7 @@ def test_to_json_string_from_struct():

actual = bbq.to_json_string(s)
expected = bpd.Series(
['{"project":"pandas","version":1}', '{"project":"numpy","version":2}'],
['{"version":1,"project":"pandas"}', '{"version":2,"project":"numpy"}'],
Comment thread
chalmerlowe marked this conversation as resolved.
dtype=dtypes.STRING_DTYPE,
)

Expand Down
Loading