Skip to content

Commit 84f0e26

Browse files
committed
pyarrow version check
1 parent 8e908d8 commit 84f0e26

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

pandas/core/arrays/_mask.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def get_mask_array_type():
129129
class MaskArray(_MaskArray, ArrowBoolArray):
130130
pass
131131

132-
except ImportError:
132+
except ModuleNotFoundError:
133133
class MaskArray(_MaskArray, NumpyBoolArray):
134134
pass
135135

pandas/core/arrays/bool.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,24 @@
55
multiple dtypes. Not all methods are implemented yet, and the
66
current implementation is not efficient.
77
"""
8+
from distutils.version import LooseVersion
89
import copy
910
import itertools
1011

1112
import numpy as np
12-
import pyarrow as pa
1313

1414
import pandas as pd
1515
from pandas.api.types import is_scalar
1616
from pandas.api.extensions import (
1717
ExtensionArray, ExtensionDtype, register_extension_dtype, take)
1818

19+
try:
20+
import pyarrow as pa
21+
if pa.__version__ < LooseVersion('0.10.0'):
22+
raise ImportError("pyarrow minimum for bool suppport is 0.10.0")
23+
except ModuleNotFoundError:
24+
raise
25+
1926

2027
@register_extension_dtype
2128
class ArrowBoolDtype(ExtensionDtype):

0 commit comments

Comments
 (0)