Skip to content

Fix pandas 3.1 deprecations, require pandas>=2.3 - #571

Open
dweindl wants to merge 1 commit into
PEtab-dev:mainfrom
dweindl:pandas_3_1
Open

dweindl wants to merge 1 commit into
PEtab-dev:mainfrom
dweindl:pandas_3_1

Conversation

@dweindl

@dweindl dweindl commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Fixes the deprecation warnings raised with pandas 3.1.0 and raises the minimum pandas version.

  • Don't pass float_precision to read_csv for pandas>=3.1, where round-trip float parsing is the default (kept for older pandas).
  • Replace deprecated inplace=True by reassignment. As a consequence, get_{condition,observable,parameter,mapping}_df no longer modify DataFrames passed by the caller.
  • Avoid fillna with incompatible fill values.
  • Use a full-length key when adding the sum row to a MultiIndex DataFrame in get_data_per_observable.
  • Turn all warnings, including DeprecationWarnings, into errors in tests. The pandas deprecation warnings derive from DeprecationWarning, which was ignored so far, which is why these went unnoticed. The SWIG-related DeprecationWarning from python-libcombine on Python 3.14 remains ignored, since raising it during module initialization segfaults.
  • Require pandas>=2.3 in accordance with NEP 29 (2.3, 3.0, 3.1 released within the past 24 months).

Tests pass with pandas 3.1.0 and 2.3.3.

Closes #570

🤖 Generated with Claude Code

* Don't pass `float_precision` to `read_csv` for pandas>=3.1, where
  round-trip float parsing is the default
* Replace deprecated `inplace=True` by reassignment. As a consequence,
  `get_{condition,observable,parameter,mapping}_df` no longer modify
  DataFrames passed by the caller
* Avoid `fillna` with incompatible fill values
* Use a full-length key when adding the sum row to a MultiIndex
  DataFrame in `get_data_per_observable`
* Turn all warnings, including `DeprecationWarning`s, into errors in
  tests. The pandas deprecation warnings derive from
  `DeprecationWarning`, which was ignored so far
* Require pandas>=2.3 in accordance with NEP 29

Closes PEtab-dev#570

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.87%. Comparing base (68be6d1) to head (0b22e8c).

Files with missing lines Patch % Lines
petab/v1/mapping.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #571      +/-   ##
==========================================
+ Coverage   78.85%   78.87%   +0.02%     
==========================================
  Files          69       69              
  Lines        8043     8051       +8     
  Branches     1445     1445              
==========================================
+ Hits         6342     6350       +8     
  Misses       1214     1214              
  Partials      487      487              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dweindl
dweindl marked this pull request as ready for review October 22, 2026 14:45
@dweindl
dweindl requested a review from a team as a code owner October 22, 2026 14:45

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.

Deprecation warnings with pandas 3.1 (inplace, read_csv(float_precision=...))

2 participants