Skip to content

Commit

Permalink
fix empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer committed Dec 16, 2024
1 parent 6cb8702 commit 5de8d0d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions xarray/core/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ def _possibly_convert_objects(values):
if (
values.dtype.kind == "O"
and as_series.dtype.kind == "O"
and as_series.size > 0
and isinstance(as_series[0], datetime | pd.Timestamp)
):
as_series = as_series.astype("=M8[us]")
Expand Down

0 comments on commit 5de8d0d

Please sign in to comment.