File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1919 ReadBuffer ,
2020 WriteBuffer ,
2121)
22+ from pandas .compat import pa_version_under8p0
2223from pandas .compat ._optional import import_optional_dependency
2324
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+
2432from pandas .core .arrays import ArrowExtensionArray
2533from pandas .core .frame import DataFrame
2634
@@ -201,6 +209,20 @@ def to_orc(
201209 if engine_kwargs is None :
202210 engine_kwargs = {}
203211
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+
204226 if engine != "pyarrow" :
205227 raise ValueError ("engine must be 'pyarrow'" )
206228 engine = import_optional_dependency (engine , min_version = "7.0.0" )
You can’t perform that action at this time.
0 commit comments