html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/7707#issuecomment-1498209121,https://api.github.com/repos/pydata/xarray/issues/7707,1498209121,IC_kwDOAMm_X85ZTNth,6628425,2023-04-05T21:58:06Z,2023-04-06T00:11:46Z,MEMBER,"I think it is fine that `CFTimeIndex.to_datetimeindex()` no longer raises an error for out-of-nanosecond-precision range dates, so we can simply relax that test for pandas versions greater than or equal to 2 and update its docstring. In practice I don't think this will come up very often (we can address later if we want probably), but one subtle issue there is that prior to October 15th, 1582, the proleptic Gregorian calendar and the ""standard"" calendar are not equivalent, so we may want to update [how we warn when converting between calendars](https://github.com/pydata/xarray/blob/84607c3b1d61e3bc2d4b07b4f12f41a40b027f6f/xarray/coding/cftimeindex.py#L640-L649). The ""standard"" calendar [according to the CF Conventions](https://cfconventions.org/Data/cf-conventions/cf-conventions-1.10/cf-conventions.html#calendar) is a mixed Julian/Gregorian calendar, which uses a Julian calendar prior to 1582-10-15 and a Gregorian calendar after. In cftime the `DatetimeGregorian` object conforms to this definition, and is what is created if you provide `""standard""` as the `calendar` argument to `num2date`: ``` >>> cftime.num2date([0, 1], units=""days since 1582-10-04"", calendar=""standard"") array([cftime.DatetimeGregorian(1582, 10, 4, 0, 0, 0, 0, has_year_zero=False), cftime.DatetimeGregorian(1582, 10, 15, 0, 0, 0, 0, has_year_zero=False)], dtype=object) >>> cftime.num2date([0, 1], units=""days since 1582-10-04"", calendar=""proleptic_gregorian"") array([cftime.DatetimeProlepticGregorian(1582, 10, 4, 0, 0, 0, 0, has_year_zero=True), cftime.DatetimeProlepticGregorian(1582, 10, 5, 0, 0, 0, 0, has_year_zero=True)], dtype=object) ``` I'll need to think more about how to handle the `test_should_cftime_be_used_source_outside_range` failure; I'm not sure if we're ready to handle changing the behavior of this until we fully address #7493.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1650481625