BUG/TST: support parametrized string dtype (#1933)

This commit is contained in:
Joris Van den Bossche
2021-05-05 10:38:26 +01:00
committed by GitHub
parent 0d38f10a95
commit 0ee710c88c
+1 -1
View File
@@ -1030,7 +1030,7 @@ class GeometryArray(ExtensionArray):
pd_dtype = pd.api.types.pandas_dtype(dtype)
if isinstance(pd_dtype, pd.StringDtype):
# ensure to return a pandas string array instead of numpy array
return pd.array(string_values, dtype="string")
return pd.array(string_values, dtype=pd_dtype)
return string_values.astype(dtype, copy=False)
else:
return np.array(self, dtype=dtype, copy=copy)