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

GH-41910: [Python] Add support for Pyodide #37822

Merged
merged 140 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
eda86ae
python changes for pyodide build
joemarshall Sep 21, 2023
1fe1845
included setup.py changes
joemarshall Sep 28, 2023
7579749
setup fixes for pyodide
joemarshall Sep 28, 2023
1bda7a9
fix so pyodide build works as default
joemarshall Sep 28, 2023
ef1ce8e
python formatting
joemarshall Sep 28, 2023
7166f46
fix emscripten checks
joemarshall Sep 28, 2023
a6e78f5
emscripten check fixes
joemarshall Sep 28, 2023
61d95ad
removed cmakelists.txt from python pr
joemarshall Sep 28, 2023
bef91cb
removed unnecessary change
joemarshall Sep 28, 2023
7b806c4
moved python cmake changes into python pr
joemarshall Oct 2, 2023
5812a83
Merge branch 'main' of github.com:apache/arrow into emscripten_python…
joemarshall Apr 5, 2024
6c61500
docstring for is_threading_enabled
joemarshall Apr 5, 2024
1f137ce
review fixes to io.pxi
joemarshall Apr 5, 2024
e3f9938
review fix
joemarshall Apr 5, 2024
bdce142
bugfix in io.pxi
joemarshall Apr 5, 2024
1222a69
use standard json settings output to move copy main arrow build setti…
joemarshall Apr 6, 2024
63c13b1
added csv to emscripten build default
joemarshall Apr 6, 2024
ceee306
fix substrait linking
joemarshall Apr 10, 2024
501d96f
check call to cmake for options
joemarshall Apr 10, 2024
c3c478d
support for single threaded joins
joemarshall Apr 10, 2024
65c2e24
Update asof_join_node.cc
joemarshall Apr 10, 2024
a8d785f
disable threaded tests when threading isn't available
joemarshall Apr 13, 2024
e5322d5
disable threaded cancellation when no threads
joemarshall Apr 14, 2024
0da860d
disable threaded & process calling tests
joemarshall Apr 14, 2024
d21f71e
makelist fixes for pyodide
joemarshall Apr 14, 2024
2549fc4
timezone fixes
joemarshall Apr 14, 2024
8a6cbfa
disable threads in parquet loading at lowest level
joemarshall Apr 15, 2024
d6897b7
typo in pandas compatibility
joemarshall Apr 15, 2024
62153f8
move timezone handling to separate file
joemarshall Apr 15, 2024
735b9a6
disable tests that use processes on emscripten
joemarshall Apr 15, 2024
2fc018e
networking test skips
joemarshall Apr 15, 2024
01524fc
separate mark for multiprocessing
joemarshall Apr 15, 2024
171ab8a
emscripten memory map issues
joemarshall Apr 15, 2024
b9b4ea2
emscripten memory mapping
joemarshall Apr 15, 2024
c24763a
disable tests when no process support
joemarshall Apr 15, 2024
304b8af
emscripten test fixes
joemarshall Apr 15, 2024
d2d223f
fixes to emscripten tests
joemarshall Apr 15, 2024
217cfb1
run pytest in chrome using selenium
joemarshall Apr 18, 2024
9bddb87
run emscripten tests on chrome, node or firefox
joemarshall Apr 18, 2024
0c7891f
archery / docker scripts to test emscripten
joemarshall Apr 20, 2024
c951270
Merge branch 'unthreaded_joins' of github.com:joemarshall/arrow into …
joemarshall Apr 20, 2024
7ad3afd
linting
joemarshall Apr 20, 2024
e0b7611
patch pyodide and correct node version so that tests run
joemarshall Apr 22, 2024
f8929cb
review fixes
joemarshall Apr 22, 2024
ce56f74
review fixes
joemarshall Apr 22, 2024
af98b11
lint
joemarshall Apr 22, 2024
15643d3
lint
joemarshall Apr 22, 2024
c257d37
lint
joemarshall Apr 22, 2024
cd05e21
added licence
joemarshall Apr 22, 2024
f8f4a9d
remove copyrighted pyodide file
joemarshall Apr 22, 2024
e8f8162
Merge branch 'main' of github.com:apache/arrow into emscripten_python…
joemarshall May 30, 2024
91bf1af
emscripten setup.py support
joemarshall May 30, 2024
0508efb
pyodide version to 0.26.0
joemarshall May 30, 2024
eeeaa78
use python 3.12 for pyodide build
joemarshall May 30, 2024
895e718
pyodide 0.26 emscripten and python updates
joemarshall May 30, 2024
15cc197
use conda for pyodide build
joemarshall May 30, 2024
8f0ead4
python test fix
joemarshall May 31, 2024
cb64ebc
removed unneeded changes from cmakelists.txt
joemarshall May 31, 2024
a5029bb
make sure emscripten specific code doesn't get loaded in non-emscript…
joemarshall May 31, 2024
2d699f4
fix test exit
joemarshall May 31, 2024
66c4466
code formatting etc suggestions
joemarshall May 31, 2024
d727ac5
Merge branch 'main' of github.com:apache/arrow into emscripten_python…
joemarshall May 31, 2024
d49090f
Merge branch 'emscripten_python_changes' of github.com:joemarshall/ar…
joemarshall May 31, 2024
333b409
rename python build scripts
joemarshall May 31, 2024
ea377f4
python build out of tree
joemarshall May 31, 2024
dec465f
tidying up
joemarshall May 31, 2024
b16fb6e
fix shared library python build deps
joemarshall May 31, 2024
f6a1dcf
Merge branch 'emscripten_python_changes' of github.com:joemarshall/ar…
joemarshall May 31, 2024
165d40c
text alignment oops
joemarshall May 31, 2024
7f92de9
only test on chrome and node.js
joemarshall Jun 5, 2024
8c7e128
Merge branch 'emscripten_python_changes' of github.com:joemarshall/ar…
joemarshall Jun 5, 2024
bf07a0f
removed changes to install_libdir/prefix, because they should be set …
joemarshall Jun 5, 2024
6960975
fix install prefix for emscripten
joemarshall Jun 5, 2024
faa05ba
moved emscripten python build to live under conda-python
joemarshall Jun 7, 2024
ba64d72
fix typo in python build script
joemarshall Jun 10, 2024
a319ccd
docker compose changes
joemarshall Jun 10, 2024
cf8cda5
review fixes
joemarshall Jun 10, 2024
3f070a7
use correct mark
joemarshall Jun 10, 2024
a355114
use correct marker
joemarshall Jun 10, 2024
bf7ecc2
marker for sockets
joemarshall Jun 10, 2024
8fee630
Apply suggestions from code review
joemarshall Jun 10, 2024
7ac8956
Merge branch 'emscripten_python_changes' of github.com:joemarshall/ar…
joemarshall Jun 10, 2024
0ae61d5
blank space fix
joemarshall Jun 12, 2024
0891801
emscripten build fixes
joemarshall Jun 12, 2024
210f928
added emscripten to tasks.yml
joemarshall Jun 12, 2024
e30ade2
include timezones in emscripten distribution
joemarshall Jun 14, 2024
7da9953
enable unbroken time tests
joemarshall Jun 14, 2024
3c08fa8
fix python version on emscripten
joemarshall Jun 14, 2024
0562269
remove timezone handling
joemarshall Jun 23, 2024
c029e73
remove timezone data
joemarshall Jun 23, 2024
9d042c4
clarify use of SOABI
joemarshall Jun 23, 2024
3b4bd02
Update python/pyarrow/conftest.py
jorisvandenbossche Jun 24, 2024
bf480ca
disable ORC for testing
jorisvandenbossche Jun 25, 2024
bebbe3a
linting - fix whitespace in pyarrow init
jorisvandenbossche Jun 25, 2024
9e71079
temp disable ORC in preset
jorisvandenbossche Jun 25, 2024
591b01e
Merge branch 'main' of github.com:apache/arrow into emscripten_python…
joemarshall Jun 26, 2024
00a740f
added dockerfile to pre-commit list
joemarshall Jun 26, 2024
e9444c2
docker lint
joemarshall Jun 26, 2024
1748968
install unzip explicitly
joemarshall Jun 26, 2024
72b4ded
reenable zlib after orc disabled
joemarshall Jun 26, 2024
135ecf6
dockerfile formatting
joemarshall Jun 26, 2024
5fef3a9
reenable orc and fix cross-compiling
joemarshall Jun 26, 2024
035477d
source nvm at right place
joemarshall Jun 26, 2024
0ea70e5
remove pointless call to python --version
joemarshall Jun 26, 2024
df20ddc
moved docker subcommands to scripts
joemarshall Jun 26, 2024
0c24203
test fixes
joemarshall Jun 26, 2024
d3a7a59
disable orc tests if no timezone data
joemarshall Jun 26, 2024
44c714e
test fix for no cffi
joemarshall Jun 26, 2024
af8b70c
mypy fixes, sorry
joemarshall Jun 26, 2024
9884524
stop runner hanging
joemarshall Jun 26, 2024
6cd1de6
mark timezone using tests
joemarshall Jun 26, 2024
6a6472a
fixes for emscripten timezone data
joemarshall Jun 26, 2024
783b807
lint
joemarshall Jun 27, 2024
ead3b08
buffering fixes for node runner
joemarshall Jun 27, 2024
1a19b36
wait for node to start in runner
joemarshall Jun 27, 2024
61cb955
reorder tests so node runs first
joemarshall Jun 27, 2024
55d3473
remove use of multiprocessing
joemarshall Jun 27, 2024
f214e39
Update ci/scripts/python_test_emscripten.sh
joemarshall Jun 27, 2024
6f77c69
Update ci/scripts/install_chromedriver.sh
joemarshall Jun 27, 2024
6d92807
docker tidying
joemarshall Jun 27, 2024
f803100
get emscripten version from pyodide
joemarshall Jun 27, 2024
a51befc
remove progress from wgets
joemarshall Jun 27, 2024
ef4c72d
use conda to install node
joemarshall Jun 27, 2024
e2d8d73
Update dev/tasks/tasks.yml
joemarshall Jun 27, 2024
46e179a
run node tests without tty
joemarshall Jun 27, 2024
9d34218
lint
joemarshall Jun 28, 2024
077d91c
Apply suggestions from code review
joemarshall Jun 28, 2024
26d3a79
review fixes
joemarshall Jun 28, 2024
2909ced
comment fixes
joemarshall Jun 28, 2024
b44d2f1
Update python/CMakeLists.txt
joemarshall Jun 28, 2024
3c6a9ec
docker lint
joemarshall Jun 28, 2024
df2c0f4
don't use pre-release python packages
joemarshall Jun 28, 2024
c7f5eb3
Apply suggestions from code review
joemarshall Jun 29, 2024
0b304c7
revert line change
joemarshall Jun 29, 2024
c2e5b65
lint
joemarshall Jun 29, 2024
daa0200
code tidying
joemarshall Jul 5, 2024
61dcd99
python tidying from code review
joemarshall Jul 5, 2024
321f96b
review fixes
joemarshall Jul 5, 2024
fa0e497
tidy
joemarshall Jul 5, 2024
71a2f6a
Merge branch 'apache:main' into emscripten_python_changes
joemarshall Jul 5, 2024
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
81 changes: 66 additions & 15 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more cod ntributor license agreements. See the NOTICE file
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
Expand Down Expand Up @@ -68,6 +68,25 @@ if(POLICY CMP0095)
cmake_policy(SET CMP0095 NEW)
endif()

# this option is used to auto-set defaults for pyarrow build
option(DUMP_ARROW_ARGUMENTS "Dump the arrow arguments then quit" OFF)

joemarshall marked this conversation as resolved.
Show resolved Hide resolved
if($ENV{PYODIDE})
# these variables are needed for building pyarrow on Emscripten
# if they aren't set, cmake cross compiling fails for python
# modules (at least under pyodide it does)
set(Python3_INCLUDE_DIR $ENV{PYTHONINCLUDE})
set(Python3_LIBRARY $ENV{CPYTHONLIB})
set(Python3_NumPy_INCLUDE_DIR $ENV{NUMPY_LIB}/core/include)
set(Python3_EXECUTABLE)
set(ENV{_PYTHON_SYSCONFIGDATA_NAME} $ENV{SYSCONFIG_NAME})

# remove any c++ standard settings from cflags and let cmake set it.
# n.b. this is here because pyodide sets -stdc++=14, which breaks pyarrow builds
string(REGEX REPLACE "-std=c\\+\\+[0-9]+" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
joemarshall marked this conversation as resolved.
Show resolved Hide resolved

endif()

# Use the first Python installation on PATH, not the newest one
set(Python3_FIND_STRATEGY "LOCATION")
# On Windows, use registry last, not first
Expand Down Expand Up @@ -260,6 +279,22 @@ include(GNUInstallDirs)

find_package(Arrow REQUIRED)

if(DUMP_ARROW_ARGUMENTS)
message(STATUS "----- ARROW_SETTINGS_DUMP -----")
get_cmake_property(_variableNames VARIABLES)
list(SORT _variableNames)
foreach(_variableName ${_variableNames})
unset(MATCHED)
string(REGEX MATCH ^ARROW_.* MATCHED ${_variableName})
if(NOT MATCHED)
continue()
endif()
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
message(STATUS "----- ARROW_SETTINGS_END -----")
return()
endif()

set(PYARROW_CPP_ROOT_DIR pyarrow/src)
set(PYARROW_CPP_SOURCE_DIR ${PYARROW_CPP_ROOT_DIR}/arrow/python)
set(PYARROW_CPP_SRCS
Expand Down Expand Up @@ -570,28 +605,42 @@ endif()

# Acero
if(PYARROW_BUILD_ACERO)
if(PYARROW_BUNDLE_ARROW_CPP)
bundle_arrow_lib(${ARROW_ACERO_SHARED_LIB} SO_VERSION ${ARROW_SO_VERSION})
if(MSVC)
bundle_arrow_import_lib(${ARROW_ACERO_IMPORT_LIB})
if(ARROW_BUILD_SHARED)

joemarshall marked this conversation as resolved.
Show resolved Hide resolved
if(PYARROW_BUNDLE_ARROW_CPP)
bundle_arrow_lib(${ARROW_ACERO_SHARED_LIB} SO_VERSION ${ARROW_SO_VERSION})
if(MSVC)
bundle_arrow_import_lib(${ARROW_ACERO_IMPORT_LIB})
endif()
endif()
endif()

set(ACERO_LINK_LIBS ArrowAcero::arrow_acero_shared)
list(APPEND CYTHON_EXTENSIONS _acero)
set(ACERO_LINK_LIBS ArrowAcero::arrow_acero_shared)
list(APPEND CYTHON_EXTENSIONS _acero)
else()
# ACERO is statically linked into libarrow_python already
joemarshall marked this conversation as resolved.
Show resolved Hide resolved
set(ACERO_LINK_LIBS)
joemarshall marked this conversation as resolved.
Show resolved Hide resolved
list(APPEND CYTHON_EXTENSIONS _acero)
joemarshall marked this conversation as resolved.
Show resolved Hide resolved
endif()
endif()

# Dataset
if(PYARROW_BUILD_DATASET)
if(PYARROW_BUNDLE_ARROW_CPP)
bundle_arrow_lib(${ARROW_DATASET_SHARED_LIB} SO_VERSION ${ARROW_SO_VERSION})
if(MSVC)
bundle_arrow_import_lib(${ARROW_DATASET_IMPORT_LIB})
if(ARROW_BUILD_SHARED)

joemarshall marked this conversation as resolved.
Show resolved Hide resolved
if(PYARROW_BUNDLE_ARROW_CPP)
bundle_arrow_lib(${ARROW_DATASET_SHARED_LIB} SO_VERSION ${ARROW_SO_VERSION})
if(MSVC)
bundle_arrow_import_lib(${ARROW_DATASET_IMPORT_LIB})
endif()
endif()
endif()

set(DATASET_LINK_LIBS ArrowDataset::arrow_dataset_shared)
set(DATASET_LINK_LIBS ArrowDataset::arrow_dataset_shared)
else()
# dataset is sttically linked into libarrow_python already
joemarshall marked this conversation as resolved.
Show resolved Hide resolved
set(DATASET_LINK_LIBS)
endif()
list(APPEND CYTHON_EXTENSIONS _dataset)

joemarshall marked this conversation as resolved.
Show resolved Hide resolved
endif()

# Parquet
Expand All @@ -612,7 +661,9 @@ if(PYARROW_BUILD_PARQUET)
endif()
set(PARQUET_LINK_LIBS Parquet::parquet_shared)
else()
set(PARQUET_LINK_LIBS Parquet::parquet_static)
# parquet is linked into libarrow_python already
# so isn't needed in the extension
set(PARQUET_LINK_LIBS "")
endif()
list(APPEND CYTHON_EXTENSIONS _parquet)
if(PYARROW_BUILD_PARQUET_ENCRYPTION)
Expand Down
6 changes: 5 additions & 1 deletion python/pyarrow/_dataset_parquet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import warnings

import pyarrow as pa
from pyarrow.lib cimport *
from pyarrow.lib import frombytes, tobytes
from pyarrow.lib import frombytes, tobytes, is_threading_enabled
from pyarrow.includes.libarrow cimport *
from pyarrow.includes.libarrow_dataset cimport *
from pyarrow.includes.libarrow_dataset_parquet cimport *
Expand Down Expand Up @@ -687,6 +687,8 @@ cdef class ParquetFragmentScanOptions(FragmentScanOptions):
new CParquetFragmentScanOptions()))
self.use_buffered_stream = use_buffered_stream
self.buffer_size = buffer_size
if pre_buffer and not is_threading_enabled():
pre_buffer=False
joemarshall marked this conversation as resolved.
Show resolved Hide resolved
self.pre_buffer = pre_buffer
if thrift_string_size_limit is not None:
self.thrift_string_size_limit = thrift_string_size_limit
Expand Down Expand Up @@ -730,6 +732,8 @@ cdef class ParquetFragmentScanOptions(FragmentScanOptions):

@pre_buffer.setter
def pre_buffer(self, bint pre_buffer):
if pre_buffer and not is_threading_enabled():
joemarshall marked this conversation as resolved.
Show resolved Hide resolved
return
self.arrow_reader_properties().set_pre_buffer(pre_buffer)

@property
Expand Down
5 changes: 4 additions & 1 deletion python/pyarrow/_parquet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ from pyarrow.lib cimport (_Weakrefable, Buffer, Schema,

from pyarrow.lib import (ArrowException, NativeFile, BufferOutputStream,
_stringify_path,
tobytes, frombytes)
tobytes, frombytes, is_threading_enabled)

cimport cpython as cp

Expand Down Expand Up @@ -1206,6 +1206,9 @@ cdef class ParquetReader(_Weakrefable):
default_arrow_reader_properties())
FileReaderBuilder builder

if pre_buffer and not is_threading_enabled():
pre_buffer=False
joemarshall marked this conversation as resolved.
Show resolved Hide resolved

if metadata is not None:
c_metadata = metadata.sp_metadata

Expand Down
3 changes: 3 additions & 0 deletions python/pyarrow/includes/libarrow_python.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,6 @@ cdef extern from "arrow/python/benchmark.h" namespace "arrow::py::benchmark":

cdef extern from "arrow/python/gdb.h" namespace "arrow::gdb" nogil:
void GdbTestSession "arrow::gdb::TestSession"()

cdef extern from "arrow/python/helpers.h" namespace "arrow::py::internal":
c_bool IsThreadingEnabled()
58 changes: 36 additions & 22 deletions python/pyarrow/io.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ from queue import Queue, Empty as QueueEmpty

from pyarrow.util import _is_path_like, _stringify_path


joemarshall marked this conversation as resolved.
Show resolved Hide resolved
# 64K
DEFAULT_BUFFER_SIZE = 2 ** 16

Expand Down Expand Up @@ -677,16 +676,19 @@ cdef class NativeFile(_Weakrefable):

self.seek(0)

writer_thread = threading.Thread(target=bg_write)
if is_threading_enabled():
writer_thread = threading.Thread(target=bg_write)
else:
writer_thread = None

# This isn't ideal -- PyBytes_FromStringAndSize copies the data from
# the passed buffer, so it's hard for us to avoid doubling the memory
buf = <uint8_t*> malloc(buffer_size)
if buf == NULL:
raise MemoryError("Failed to allocate {0} bytes"
.format(buffer_size))

joemarshall marked this conversation as resolved.
Show resolved Hide resolved
writer_thread.start()
if writer_thread:
joemarshall marked this conversation as resolved.
Show resolved Hide resolved
writer_thread.start()

cdef int64_t total_bytes = 0
cdef int32_t c_buffer_size = buffer_size
Expand All @@ -706,18 +708,23 @@ cdef class NativeFile(_Weakrefable):
pybuf = cp.PyBytes_FromStringAndSize(<const char*>buf,
bytes_read)

if writer_thread.is_alive():
while write_queue.full():
time.sleep(0.01)
else:
break
if writer_thread is not None:
if writer_thread.is_alive():
while write_queue.full():
time.sleep(0.01)
else:
break

write_queue.put_nowait(pybuf)
write_queue.put_nowait(pybuf)

else:
# no background thread
stream.write(pybuf)
finally:
free(buf)
done = True

joemarshall marked this conversation as resolved.
Show resolved Hide resolved
writer_thread.join()
if writer_thread is not None:
writer_thread.join()
if exc_info is not None:
raise exc_info[0], exc_info[1], exc_info[2]

Expand Down Expand Up @@ -753,26 +760,33 @@ cdef class NativeFile(_Weakrefable):
except Exception as e:
exc_info = sys.exc_info()

writer_thread = threading.Thread(target=bg_write)
writer_thread.start()
if is_threading_enabled():
writer_thread = threading.Thread(target=bg_write)
writer_thread.start()
else:
writer_thread = None

try:
while True:
buf = stream.read(buffer_size)
if not buf:
break

if writer_thread.is_alive():
while write_queue.full():
time.sleep(0.01)
else:
break
if writer_thread is not None:
if writer_thread.is_alive():
while write_queue.full():
time.sleep(0.01)
else:
break

write_queue.put_nowait(buf)
write_queue.put_nowait(buf)
else:
# no threading
self.write(buf)
finally:
done = True

joemarshall marked this conversation as resolved.
Show resolved Hide resolved
writer_thread.join()
if writer_thread is not None:
writer_thread.join()
if exc_info is not None:
raise exc_info[0], exc_info[1], exc_info[2]

Expand Down
4 changes: 4 additions & 0 deletions python/pyarrow/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ def set_cpu_count(int count):
check_status(SetCpuThreadPoolCapacity(count))


def is_threading_enabled():
return libarrow_python.IsThreadingEnabled()
joemarshall marked this conversation as resolved.
Show resolved Hide resolved


Type_NA = _Type_NA
Type_BOOL = _Type_BOOL
Type_UINT8 = _Type_UINT8
Expand Down
4 changes: 2 additions & 2 deletions python/pyarrow/pandas_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import numpy as np

import pyarrow as pa
from pyarrow.lib import _pandas_api, frombytes # noqa
from pyarrow.lib import _pandas_api, frombytes, is_threading_enabled # noqa


_logical_type_map = {}
Expand Down Expand Up @@ -608,7 +608,7 @@ def _can_definitely_zero_copy(arr):
arr.flags.contiguous and
issubclass(arr.dtype.type, np.integer))

if nthreads == 1:
if nthreads == 1 or not is_threading_enabled():
joemarshall marked this conversation as resolved.
Show resolved Hide resolved
arrays = [convert_column(c, f)
for c, f in zip(columns_to_convert, convert_fields)]
else:
Expand Down
Loading