File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 6
6
import numpy as np
7
7
import pandas as pd
8
8
import pyarrow as pa
9
+ import pyarrow .compute
9
10
from pandas .api .types import is_scalar , union_categoricals
10
11
11
12
from dask .array import Array
@@ -198,7 +199,9 @@ def _(x, index=None):
198
199
199
200
for k , v in out .items ():
200
201
if isinstance (v .array , pd .arrays .ArrowExtensionArray ):
201
- values = pa .chunked_array ([v .array ]).combine_chunks ()
202
+ values = pyarrow .compute .take (
203
+ pyarrow .array (v .array ), pyarrow .array ([], type = "int32" )
204
+ )
202
205
out [k ] = v ._constructor (
203
206
pd .array (values , dtype = v .array .dtype ), index = v .index , name = v .name
204
207
)
@@ -240,7 +243,6 @@ def get_pyarrow_table_from_pandas(obj, **kwargs):
240
243
@from_pyarrow_table_dispatch .register ((pd .DataFrame ,))
241
244
def get_pandas_dataframe_from_pyarrow (meta , table , ** kwargs ):
242
245
# `kwargs` must be supported by `pyarrow.Table.to_pandas`
243
- import pyarrow as pa
244
246
245
247
def default_types_mapper (pyarrow_dtype : pa .DataType ) -> object :
246
248
# Avoid converting strings from `string[pyarrow]` to
You can’t perform that action at this time.
0 commit comments