File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 5
5
6
6
import numpy as np
7
7
8
+ from pandas ._libs .lib import infer_dtype
8
9
from pandas .util ._decorators import cache_readonly
9
10
10
11
import pandas as pd
@@ -114,10 +115,14 @@ def dtype(self):
114
115
Endianness .NATIVE ,
115
116
)
116
117
elif is_string_dtype (dtype ):
117
- # TODO: is_string_dtype() can return True for non-string dtypes like
118
- # numpy arrays, because they all have an "object" dtype.
119
- # Think on how to improve the check here.
120
- return (DtypeKind .STRING , 8 , dtype_to_arrow_c_fmt (dtype ), Endianness .NATIVE )
118
+ if infer_dtype (self ._col ) == "string" :
119
+ return (
120
+ DtypeKind .STRING ,
121
+ 8 ,
122
+ dtype_to_arrow_c_fmt (dtype ),
123
+ Endianness .NATIVE ,
124
+ )
125
+ raise NotImplementedError ("Non-string object dtypes are not supported yet" )
121
126
else :
122
127
return self ._dtype_from_pandasdtype (dtype )
123
128
You can’t perform that action at this time.
0 commit comments