Skip to content

Commit 873d0ee

Browse files
fix: Fix issue mishandling chunked array while loading data (#2051)
1 parent a3edeab commit 873d0ee

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

bigframes/core/local_data.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,10 @@ def _adapt_pandas_series(
277277
)
278278
return pa.array(series, type=pa.string()), bigframes.dtypes.GEO_DTYPE
279279
try:
280-
return _adapt_arrow_array(pa.array(series))
280+
pa_arr = pa.array(series)
281+
if isinstance(pa_arr, pa.ChunkedArray):
282+
return _adapt_chunked_array(pa_arr)
283+
return _adapt_arrow_array(pa_arr)
281284
except pa.ArrowInvalid as e:
282285
if series.dtype == np.dtype("O"):
283286
try:

tests/system/small/test_dataframe.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ def test_df_construct_structs(session):
138138
)
139139

140140

141+
def test_df_construct_local_concat_pd(scalars_pandas_df_index, session):
142+
pd_df = pd.concat([scalars_pandas_df_index, scalars_pandas_df_index])
143+
144+
bf_df = session.read_pandas(pd_df)
145+
146+
pd.testing.assert_frame_equal(
147+
bf_df.to_pandas(), pd_df, check_index_type=False, check_dtype=False
148+
)
149+
150+
141151
def test_df_construct_pandas_set_dtype(scalars_dfs):
142152
columns = [
143153
"int64_too",

0 commit comments

Comments
 (0)