Skip to content

fix: require pandas>=2.3.3 on Python 3.14 - #530

Merged
hirosassa merged 1 commit into
masterfrom
fix/pandas-py314-segfault
Jul 25, 2026
Merged

fix: require pandas>=2.3.3 on Python 3.14#530
hirosassa merged 1 commit into
masterfrom
fix/pandas-py314-segfault

Conversation

@hiro-o918

@hiro-o918 hiro-o918 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Background

Investigating why only the tests (ubuntu-latest, py314) job failed on #529 revealed the root cause is pandas, not pillow.

  • The failure is a segmentation fault inside pandas' datetime C extension at test/test_pandas_type_config.py::test_datetime_success, deterministically reproducible on re-run: https://github.com/m3dev/gokart/actions/runs/29820432602
  • pandas 2.2.3 ships no cp314 wheels, so on Python 3.14 it is always built from sdist — an unsupported, untested configuration (the first pandas release with cp314 wheels is 2.3.3)
  • A full diff of all 82 installed packages between the last green master run and the failing run shows the only change is pillow 12.2.0 → 12.3.0. Pillow 12.3.0's C-extension optimizations changed the process memory layout, which exposed latent undefined behavior in the sdist-built pandas — pillow is the trigger, pandas is the actual defect.

Changes

  • pyproject.toml: split the pandas requirement with environment markers — unchanged (unconstrained) for python_version < '3.14', pandas>=2.3.3 for python_version >= '3.14'
  • uv.lock: regenerated. pandas is forked to 2.3.3 (cp314 wheels) for Python >= 3.14 while staying at 2.2.3 for <= 3.13. No other package versions changed (only mechanical resolution-marker splits).

QA

  • uv sync --locked -p 3.14 --group test installs pandas 2.3.3 from a prebuilt cp314 wheel (Tag: cp314-cp314-macosx_11_0_arm64)
  • test/test_pandas_type_config.py (previously segfaulting) passes all 6 tests on Python 3.14
  • uv sync --locked -p 3.12 still resolves pandas 2.2.3 (resolution for <= 3.13 untouched); the same tests pass
  • uv run ruff check . / uv run ruff format --check . / uv run mypy gokart test all pass
  • Marker boundary conditions evaluated with packaging.markers.Marker.evaluate() (3.13.9 → old branch; 3.14.0rc1 / 3.14.0 / 3.15.0 → new branch; mutually exclusive and exhaustive)

- pandas 2.2.3 ships no cp314 wheels, so on Python 3.14 it is built
  from sdist; the resulting C extension segfaults deterministically
  (reproduced in test_pandas_type_config.py::test_datetime_success)
- restrict the requirement with an environment marker so resolution
  for Python <= 3.13 is unchanged
@hiro-o918
hiro-o918 force-pushed the fix/pandas-py314-segfault branch from 1d87f89 to 7b52654 Compare July 22, 2026 06:12
@hiro-o918 hiro-o918 changed the title fix: Python 3.14 で pandas 2.3.3 以上を要求 fix: require pandas>=2.3.3 on Python 3.14 Jul 22, 2026
@hiro-o918
hiro-o918 marked this pull request as ready for review July 22, 2026 06:21

@hirosassa hirosassa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@hirosassa
hirosassa merged commit e9f2198 into master Jul 25, 2026
8 checks passed
@hirosassa
hirosassa deleted the fix/pandas-py314-segfault branch July 25, 2026 10:00
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.

2 participants