File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 19
19
ReadBuffer ,
20
20
WriteBuffer ,
21
21
)
22
+ from pandas .compat import pa_version_under8p0
22
23
from pandas .compat ._optional import import_optional_dependency
23
24
25
+ from pandas .core .dtypes .common import (
26
+ is_categorical_dtype ,
27
+ is_interval_dtype ,
28
+ is_period_dtype ,
29
+ is_unsigned_integer_dtype ,
30
+ )
31
+
24
32
from pandas .core .arrays import ArrowExtensionArray
25
33
from pandas .core .frame import DataFrame
26
34
@@ -201,6 +209,20 @@ def to_orc(
201
209
if engine_kwargs is None :
202
210
engine_kwargs = {}
203
211
212
+ # If unsupported dtypes are found raise NotImplementedError
213
+ # In Pyarrow 8.0.0 this check will no longer be needed
214
+ if pa_version_under8p0 :
215
+ for dtype in df .dtypes :
216
+ if (
217
+ is_categorical_dtype (dtype )
218
+ or is_interval_dtype (dtype )
219
+ or is_period_dtype (dtype )
220
+ or is_unsigned_integer_dtype (dtype )
221
+ ):
222
+ raise NotImplementedError (
223
+ "The dtype of one or more columns is not supported yet."
224
+ )
225
+
204
226
if engine != "pyarrow" :
205
227
raise ValueError ("engine must be 'pyarrow'" )
206
228
engine = import_optional_dependency (engine , min_version = "7.0.0" )
You can’t perform that action at this time.
0 commit comments