Skip to content

Pin pandas to exclude 3.0.4 (segfault constructing pd.Timedelta on Python 3.14) - #23022

Merged
rapids-bot[bot] merged 4 commits into
NVIDIA:mainfrom
galipremsagar:pin-pandas-exclude-3.0.4
Jun 29, 2026
Merged

Pin pandas to exclude 3.0.4 (segfault constructing pd.Timedelta on Python 3.14)#23022
rapids-bot[bot] merged 4 commits into
NVIDIA:mainfrom
galipremsagar:pin-pandas-exclude-3.0.4

Conversation

@galipremsagar

Copy link
Copy Markdown
Contributor

Description

pandas 3.0.4 (released 2026-06-28) segfaults when constructing any pd.Timedelta on Python 3.14, which crashes import cudf at module-load time (the DatetimeIndex class body in python/cudf/cudf/core/index.py builds a set of pd.Timedelta constants). This breaks all of cudf / cudf.pandas and the pandas-tests CI job (pytest segfaults during collection, before any test runs).

Minimal reproducer — pristine venv with only pandas==3.0.4 + numpy on CPython 3.14, no cudf involved:

import pandas as pd
pd.Timedelta(days=28)   # Fatal Python error: Segmentation fault

It is a regression from pandas 3.0.3 (works) — pandas is the only changed package — and reproduces with numpy 2.3.3 (pandas 3.0.4's own declared minimum for py3.14) and 2.4.6. The faulthandler C stack shows unbounded recursion between pandas/_libs/tslibs/timedeltas and numpy's _multiarray_umath.

Filed upstream: pandas-dev/pandas#66086

This PR pins pandas != 3.0.4 in the runtime dependency (run_common in dependencies.yaml, regenerated into the wheel/conda metadata). The exclusion form (rather than <3.0.4) lets a fixed pandas (e.g. 3.0.5) be picked up automatically; the pin should be removed once that ships.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@galipremsagar
galipremsagar requested a review from a team as a code owner June 28, 2026 23:08
@galipremsagar
galipremsagar requested a review from jameslamb June 28, 2026 23:08
@github-actions github-actions Bot added Python Affects Python cuDF API. pylibcudf Issues specific to the pylibcudf package labels Jun 28, 2026
@GPUtester GPUtester moved this to In Progress in cuDF Python Jun 28, 2026
@galipremsagar galipremsagar added bug Something isn't working non-breaking Non-breaking change labels Jun 28, 2026
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5102ffc7-4b08-4abb-b2bd-66964b93174c

📥 Commits

Reviewing files that changed from the base of the PR and between 5646b5f and 5fe2b2e.

📒 Files selected for processing (9)
  • conda/environments/all_cuda-129_arch-aarch64.yaml
  • conda/environments/all_cuda-129_arch-x86_64.yaml
  • conda/environments/all_cuda-133_arch-aarch64.yaml
  • conda/environments/all_cuda-133_arch-x86_64.yaml
  • dependencies.yaml
  • python/cudf/pyproject.toml
  • python/cudf_polars/pyproject.toml
  • python/dask_cudf/pyproject.toml
  • python/pylibcudf/pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (2)
  • python/cudf/pyproject.toml
  • python/pylibcudf/pyproject.toml

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Excluded the problematic pandas==3.0.4 by tightening pandas upper bounds across supported conda environments and Python package configurations.
    • Updated shared pandas constraints and related test/extras pins to keep pandas 3.0.x working while avoiding the 3.0.4 release.
    • Refined “oldest” and compatibility test matrices so they won’t select pandas==3.0.4 (temporary cap noted in the dependency configs).

Walkthrough

Narrows pandas version constraints in dependencies.yaml, several pyproject.toml files, and four conda environment YAML files to exclude versions at or above 3.0.4a0. Updates one dask_cudf copyright line.

Changes

Pandas 3.0.4 exclusion

Layer / File(s) Summary
Canonical pin and pyproject.toml updates
dependencies.yaml, python/cudf/pyproject.toml, python/dask_cudf/pyproject.toml, python/pylibcudf/pyproject.toml, python/cudf_polars/pyproject.toml
dependencies.yaml updates the shared &pandas anchor and test matrix pins to cap pandas below 3.0.4a0 and adds comments about the pandas 3.0.4 / Python 3.14 pd.Timedelta import failure; the pyproject.toml files apply the same cap, and dask_cudf/pyproject.toml also updates its copyright text.
Generated conda environment files
conda/environments/all_cuda-129_arch-aarch64.yaml, conda/environments/all_cuda-129_arch-x86_64.yaml, conda/environments/all_cuda-133_arch-aarch64.yaml, conda/environments/all_cuda-133_arch-x86_64.yaml
All four conda environment specs change their pandas constraint from >=3.0.0,<3.1.0 to >=3.0.0,<3.0.4a0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • rapidsai/cudf#22189: Updates the same test_cudf_pandas_compat matrix area in dependencies.yaml that this PR adjusts.

Suggested labels

ci, conda

Suggested reviewers

  • vyasr
  • mroeschke
  • jameslamb
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: excluding pandas 3.0.4 due to a Timedelta segfault on Python 3.14.
Description check ✅ Passed The description is detailed and directly matches the dependency pinning change and its motivation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@dependencies.yaml`:
- Around line 917-920: The `pandas 3.0.4` exclusion is still being bypassed in
the test selectors, so update the selector definitions for
`test_python_cudf_common` and `test_cudf_pandas_compat` to exclude `3.0.4` as
well. Make the same version constraint used by the `pandas` dependency anchor
apply in these test env selectors so Python 3.14 jobs cannot resolve to the
broken release. Locate the relevant test selector entries by their names and
ensure they no longer allow `pandas==3.0.*` without the explicit `!=3.0.4`
guard.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e0f954f8-749c-42e9-b67b-13c2028a7ca3

📥 Commits

Reviewing files that changed from the base of the PR and between 4d2410a and 67e5b76.

📒 Files selected for processing (8)
  • conda/environments/all_cuda-129_arch-aarch64.yaml
  • conda/environments/all_cuda-129_arch-x86_64.yaml
  • conda/environments/all_cuda-133_arch-aarch64.yaml
  • conda/environments/all_cuda-133_arch-x86_64.yaml
  • dependencies.yaml
  • python/cudf/pyproject.toml
  • python/dask_cudf/pyproject.toml
  • python/pylibcudf/pyproject.toml

Comment thread dependencies.yaml Outdated
…t selectors

The run_common runtime pin covers wheel/conda installs, but the
test_python_cudf_common (oldest) and test_cudf_pandas_compat matrix
selectors still listed a bare pandas==3.0.*, which can resolve to the
broken 3.0.4 on Python 3.14. Mirror the !=3.0.4 exclusion there too.
Addresses CodeRabbit review on PR NVIDIA#23022.
@github-actions github-actions Bot added the cudf-polars Issues specific to cudf-polars label Jun 29, 2026

@bdice bdice left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How confident are we that a fix will land in 3.0.5? I would feel more confident with an upper bound pinning like <3.0.4a0, at least until a fix is filed upstream.

Approving to unblock CI either way.

Per review, cap below 3.0.4 rather than excluding only that exact
version: we can't assume a later 3.0.x will be fixed, so this avoids
auto-upgrading into another broken release. Raise the bound once an
upstream fix is confirmed (pandas-dev/pandas#66086).
@galipremsagar

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 9a27794 into NVIDIA:main Jun 29, 2026
138 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in cuDF Python Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cudf-polars Issues specific to cudf-polars non-breaking Non-breaking change pylibcudf Issues specific to the pylibcudf package Python Affects Python cuDF API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants