Skip to content

Commit 1ea64cf

Browse files
fix typing and interchange tests
1 parent 7c00808 commit 1ea64cf

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pandas/core/arrays/string_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class StringDtype(StorageExtensionDtype):
110110
"""
111111

112112
@property
113-
def name(self) -> str:
113+
def name(self) -> str: # type: ignore[override]
114114
if self._na_value is libmissing.NA:
115115
return "string"
116116
else:

pandas/core/interchange/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,12 @@ def dtype_to_arrow_c_fmt(dtype: DtypeObj) -> str:
135135
if format_str is not None:
136136
return format_str
137137

138-
if lib.is_np_dtype(dtype, "M"):
138+
if isinstance(dtype, pd.StringDtype):
139+
# TODO(infer_string) this should be LARGE_STRING for pyarrow storage,
140+
# but current tests don't cover this distinction
141+
return ArrowCTypes.STRING
142+
143+
elif lib.is_np_dtype(dtype, "M"):
139144
# Selecting the first char of resolution string:
140145
# dtype.str -> '<M8[ns]' -> 'n'
141146
resolution = np.datetime_data(dtype)[0][0]

0 commit comments

Comments
 (0)