Repository navigation
fix: support pandas 3 without regressing multilabel matching - #146
Merged
Merged
Conversation
afermg
force-pushed
the
compat/pandas3
branch
from
September 30, 2026 18:11
f1f27ec to
db72f8e
Compare
Normalize pandas extension-array cells without changing native lists, NumPy arrays, or missing cells. Require DuckDB 1.4.4 for pandas 3 inferred string columns. Remove the temporary pandas cap and test both pandas majors with the minimum DuckDB version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review scope
Follow-up to the merged #144. Rebased onto current
main(3f4770c); this PR now contains only the pandas compatibility changes in db72f8e. Python version requirements and the existing Python CI matrix are unchanged.Summary
pandas<3constraint introduced in feat: support Python 3.13/3.14 with pandas 2 #144.strcolumns withData type 'str' not recognized.ExtensionArraycells infind_pairs_multilabelusing.tolist(). This coversgroupby().unique()string arrays without breaking NumPy integer/float32/bool arrays or whole-cell missing values, which unconditionalapply(list)does.--no-syncduring tests so the pandas 2 lockfile cannot silently replace the selected pandas major.Runtime cost
Local normalization-only timings per 100,000 profiles (three labels each; median of nine runs, Python 3.12): ~13 ms for existing NumPy arrays (pandas 2.3.3), ~402 ms for Python-backed StringArrays, and ~604 ms for Arrow-backed StringArrays (pandas 3.0.6). Multilabel
average_precisionnormalizes twice, for positive and negative pairs. These are synthetic preprocessing measurements, not total matching times or an overall slowdown estimate.Validation
All runs use DuckDB 1.4.4:
Before the normalization fix, six of the new regression cases failed under pandas 3. After the fix, all pass.
After rebasing onto the merged #144,
git range-diffconfirms an unchanged patch and the resulting source tree is identical to the previously tested tree. Re-ran the 25 focused compatibility/multilabel tests under both pandas 2 and 3: all pass.ruff check,ruff format --check,uv lock --check, andgit diff --checkalso pass.