Remove pyarrow workaround. (#7884)
This commit is contained in:
parent
65e6d73b95
commit
8ba4722d04
@ -2,7 +2,6 @@
|
|||||||
# pylint: disable=too-many-return-statements, import-error
|
# pylint: disable=too-many-return-statements, import-error
|
||||||
'''Data dispatching for DMatrix.'''
|
'''Data dispatching for DMatrix.'''
|
||||||
import ctypes
|
import ctypes
|
||||||
from distutils import version
|
|
||||||
import json
|
import json
|
||||||
import warnings
|
import warnings
|
||||||
import os
|
import os
|
||||||
@ -590,13 +589,7 @@ def _from_arrow(
|
|||||||
if enable_categorical:
|
if enable_categorical:
|
||||||
raise ValueError("categorical data in arrow is not supported yet.")
|
raise ValueError("categorical data in arrow is not supported yet.")
|
||||||
|
|
||||||
major, _, _ = version.StrictVersion(pa.__version__).version
|
rb_iter = iter(data.to_batches())
|
||||||
if major == 4:
|
|
||||||
rb_iter = iter(data.to_batches())
|
|
||||||
else:
|
|
||||||
# use_async=True to workaround pyarrow 6.0.1 hang,
|
|
||||||
# see Modin-3982 and ARROW-15362
|
|
||||||
rb_iter = iter(data.to_batches(use_async=True))
|
|
||||||
it = record_batch_data_iter(rb_iter)
|
it = record_batch_data_iter(rb_iter)
|
||||||
next_callback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_void_p)(it)
|
next_callback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_void_p)(it)
|
||||||
handle = ctypes.c_void_p()
|
handle = ctypes.c_void_p()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user