Visitar URL original
FIX: Avoid deprecated pandas Series growth in reductions by nawaaaaaAaar · Pull Request #1801 · fairlearn/fairlearn · GitHub
Skip to content

FIX: Avoid deprecated pandas Series growth in reductions - #1801

Merged
taharallouche merged 3 commits into
fairlearn:mainfrom
nawaaaaaAaar:fix/pandas-series-growth
Oct 23, 2026
Merged

taharallouche merged 3 commits into
fairlearn:mainfrom
nawaaaaaAaar:fix/pandas-series-growth

Conversation

@nawaaaaaAaar

@nawaaaaaAaar nawaaaaaAaar commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fix the pandas 3.1 compatibility failures in the reductions suite without weakening warnings-as-errors.

The all-deps CI logs on #1741 show Pandas4Warning when constraint bases and ExponentiatedGradient enlarge a Series via .at. This is a separate compatibility fix, not a duplicate of #1741's deterministic-collection work.

  • Use .loc for the seven insertions of new Series keys.
  • Initialize neg_basis_present as boolean: after replacing .at, pandas also correctly exposes its previously incompatible float initialization.
  • Update the same insertion pattern in the LP-failure test helper and replace deprecated reset_index(inplace=True) in the group-loss test.
  • Add four regression cases covering demographic parity, equalized odds, bounded group loss, and end-to-end ExponentiatedGradient fit/predict. Add a release note.

No warning filters, algorithm changes, or dependency pins are introduced.

Reproduction on unchanged upstream

Base: 21c6b4c384126d388e2da7ba13ff0c434ebd42cd.

With only the new regression file added to unchanged production source:

pytest -q test/unit/reductions/test_series_growth.py
4 failed (Pandas4Warning)

The two LP-failure cases and group-loss GPA test also fail on a clean upstream worktree: 3 failed. These are the three existing failures remaining after fixing production Series growth.

Tests

  • New tests added.
  • Existing tests adjusted for the same pandas compatibility changes.

Executed on Python 3.12.15 / pandas 3.1.0:

pytest -q test/unit/reductions
3909 passed, 320 skipped, 888 deselected
ruff check <changed Python files>
passed
ruff format --check <changed Python files>
passed
uv build
sdist and wheel built

Minimum-dependency compatibility check on Python 3.11.17 / pandas 2.0.3 / numpy 1.24.4 / scikit-learn 1.6.0 / scipy 1.9.3:

pytest -q test/unit/reductions/test_series_growth.py
4 passed

Documentation

  • Release note in the unreleased v0.16.0 notes.
  • No API changes.

This addresses the reproduced reductions compatibility failure. It does not claim to fix separate OpenML network errors or other optional-ML CI failures.

AI disclosure: investigated, implemented and tested using Perplexity Computer. No independent human review is claimed.

Copilot AI balanced review requested due to automatic review settings October 22, 2026 14:41

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@taharallouche
taharallouche merged commit 01a8019 into fairlearn:main Oct 23, 2026
35 of 39 checks passed
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.

3 participants