From 4cb042ce3b3d2b19422518e45c43a4f018ea79c7 Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Sun, 21 Oct 2018 14:00:02 -0700 Subject: [PATCH 1/2] Fix pyarrow compat --- pandas/io/feather_format.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandas/io/feather_format.py b/pandas/io/feather_format.py index 1bc6526214a91..9e345734e7f7f 100644 --- a/pandas/io/feather_format.py +++ b/pandas/io/feather_format.py @@ -31,6 +31,8 @@ def _try_import(): "or via pip\n" "pip install -U feather-format\n") + import pyarrow # used by feather; we'll need to check the version later + return feather @@ -109,4 +111,9 @@ def read_feather(path, nthreads=1): if LooseVersion(feather.__version__) < LooseVersion('0.4.0'): return feather.read_dataframe(path) - return feather.read_dataframe(path, nthreads=nthreads) + if LooseVersion(pyarrow.__version__) < LooseVersion('0.10') + return feather.read_dataframe(path, nthreads=nthreads) + + # pyarrow>=0.10 has `use_threads` kwarg instead of `nthreads` + use_threads = nthreads > 1 + return feather.read_dataframe(path, use_threads=use_threads) From d7b0ff1488472222b96bbc05713fc32bc1f230e7 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Sun, 21 Oct 2018 14:13:04 -0700 Subject: [PATCH 2/2] Typo fixup --- pandas/io/feather_format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/feather_format.py b/pandas/io/feather_format.py index 9e345734e7f7f..b4369781a7758 100644 --- a/pandas/io/feather_format.py +++ b/pandas/io/feather_format.py @@ -111,7 +111,7 @@ def read_feather(path, nthreads=1): if LooseVersion(feather.__version__) < LooseVersion('0.4.0'): return feather.read_dataframe(path) - if LooseVersion(pyarrow.__version__) < LooseVersion('0.10') + if LooseVersion(pyarrow.__version__) < LooseVersion('0.10'): return feather.read_dataframe(path, nthreads=nthreads) # pyarrow>=0.10 has `use_threads` kwarg instead of `nthreads`