Skip to content

TST: add mixed-int-string Index to conftest fixtures#65177

Draft
jbrockmendel wants to merge 2 commits intopandas-dev:mainfrom
jbrockmendel:tst-54072
Draft

TST: add mixed-int-string Index to conftest fixtures#65177
jbrockmendel wants to merge 2 commits intopandas-dev:mainfrom
jbrockmendel:tst-54072

Conversation

@jbrockmendel
Copy link
Copy Markdown
Member

Summary

  • closes TST: mixed_int_string Index #54072
  • Add "mixed-int-string": Index([0, "a", 1, "b", 2, "c"]) to indices_dict in conftest.py
  • Fix the 27 tests it broke by: using safe_sort_index for order-independent comparisons, expecting TypeError for genuinely unsortable operations (argsort, sort_values, searchsorted, numpy min/max), and handling RuntimeWarning for unorderable MultiIndex union

Test plan

  • All 27 previously-failing mixed-int-string tests now pass
  • Full regression run on all 9 modified test files: 6330 passed, 0 failed
  • pre-commit hooks pass
  • mypy clean (no new errors)

🤖 Generated with Claude Code

Add a "mixed-int-string" entry (Index([0, "a", 1, "b", 2, "c"])) to
indices_dict and fix the 27 tests it broke. All failures stemmed from
Python 3 not supporting < / > between int and str.

- Use safe_sort_index instead of sort_values for order-independent
  comparisons in set-op tests
- Expect TypeError for argsort, sort_values, searchsorted, and
  numpy min/max reductions on mixed-type indices
- Handle RuntimeWarning for unorderable MultiIndex union

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jbrockmendel jbrockmendel added the Testing pandas testing functions or related to the test suite label Apr 11, 2026
…ndas-dev#54072)

Add index_sortable, index_flat_sortable, index_with_missing_sortable,
and index_or_series_obj_orderable fixtures that exclude the
mixed-int-string Index via params filtering. Use these in tests that
require sorting/ordering so test bodies stay clean with no try/except
that could swallow bugs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Testing pandas testing functions or related to the test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TST: mixed_int_string Index

1 participant