diff --git a/xarray/coding/cftimeindex.py b/xarray/coding/cftimeindex.py index e236dca3693..faf1a044505 100644 --- a/xarray/coding/cftimeindex.py +++ b/xarray/coding/cftimeindex.py @@ -157,7 +157,7 @@ def f(self): def get_date_type(self): - if self.data: + if self._data.size: return type(self._data[0]) else: return None