We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1f5245 commit c3224efCopy full SHA for c3224ef
xarray/core/indexes.py
@@ -135,7 +135,7 @@ def _repr_inline_(self, max_width):
135
def _maybe_cast_to_cftimeindex(index: pd.Index) -> pd.Index:
136
from xarray.coding.cftimeindex import CFTimeIndex
137
138
- if len(index) > 0 and index.dtype == "O":
+ if len(index) > 0 and index.dtype == "O" and not isinstance(index, CFTimeIndex):
139
try:
140
return CFTimeIndex(index)
141
except (ImportError, TypeError):
0 commit comments