Registry Mirror
Skip to content

Conversation

@C1-BA-B1-F3

Copy link
Copy Markdown
Contributor

Fixes #11402

Problem

Nightly upstream-dev CI is failing with a segfault in pandas when pd.to_datetime() is called at module level (inside @pytest.mark.parametrize decorator arguments). The segfault occurs during test collection, crashing all xdist workers.

The root cause is pd.to_datetime() being called with unit="ns" at import time in test_coding_times.py, which triggers a pandas bug in the nightly build.

Fix

Move the pd.to_datetime() calls from the module-level @pytest.mark.parametrize into the test function body. Instead of passing pre-constructed datetime arrays as parameters, pass raw string lists and construct the datetime objects inside the test.

This is a minimal, surgical fix that:

  • Avoids the pandas segfault by deferring datetime construction to test runtime
  • Preserves the exact same test logic and assertions
  • All 307 tests pass, 854 skipped, 1 xfailed

…y segfault

Move pd.to_datetime() calls from module-level @pytest.mark.parametrize
into the test function body. This avoids a segfault in pandas nightly
caused by constructing datetime objects at module import time.

Fixes pydata#11402
@dcherian dcherian added the run-upstream Run upstream CI label Jun 25, 2026
@headtr1ck headtr1ck added the plan to merge Final call for comments label Oct 9, 2026
@headtr1ck
headtr1ck merged commit 3bbe36b into pydata:main Oct 9, 2026
58 of 59 checks passed
@welcome

welcome Bot commented Oct 9, 2026

Copy link
Copy Markdown

Congratulations on completing your first pull request! Welcome to Xarray! We are proud of you, and hope to see you again! celebration gif

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

Labels

plan to merge Final call for comments run-upstream Run upstream CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⚠️ Nightly upstream-dev CI failed ⚠️

3 participants