Skip to content

Preserve NaT in the standard-calendar cftime fallback - #11992

Open
mahdi-taghi wants to merge 1 commit into
pydata:mainfrom
mahdi-taghi:fix/cftime-missing-values-11988
Open

mahdi-taghi wants to merge 1 commit into
pydata:mainfrom
mahdi-taghi:fix/cftime-missing-values-11988

Conversation

@mahdi-taghi

@mahdi-taghi mahdi-taghi commented Dec 5, 2026 •

Copy link
Copy Markdown

Description

When decoding standard-calendar times falls back to cftime, a missing value can show up as the reference date. In the example from #11988, that makes the fill value look exactly like a real zero offset.

This keeps the cftime mask long enough to write NaT into those positions in the NumPy result. The regression test checks that the missing value becomes NaT and the real reference date comes through on both NumPy and Dask arrays.

Checklist

AI Disclosure

  • This PR contains AI-assisted code and tests.
  • The changes were tested locally.
  • I have completed a personal review of the diff and take responsibility for these changes.

An AI coding assistant helped reproduce the standard-calendar case, write the regression test, and implement the fix.

@mahdi-taghi
mahdi-taghi marked this pull request as ready for review December 5, 2026 09:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant