Skip to content

Commit fb49a3b

Browse files
Fix DatetimeAccessor strftime errors due to upstream changes (#10550)
1 parent ce33788 commit fb49a3b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xarray/core/accessor_dt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def _strftime_through_cftimeindex(values, date_format: str):
206206
values_as_cftimeindex = CFTimeIndex(duck_array_ops.ravel(values))
207207

208208
field_values = values_as_cftimeindex.strftime(date_format)
209-
return field_values.values.reshape(values.shape)
209+
return field_values.to_numpy().reshape(values.shape)
210210

211211

212212
def _strftime_through_series(values, date_format: str):
@@ -215,7 +215,7 @@ def _strftime_through_series(values, date_format: str):
215215
"""
216216
values_as_series = pd.Series(duck_array_ops.ravel(values), copy=False)
217217
strs = values_as_series.dt.strftime(date_format)
218-
return strs.values.reshape(values.shape)
218+
return strs.to_numpy().reshape(values.shape)
219219

220220

221221
def _strftime(values, date_format):

0 commit comments

Comments
 (0)