TST: add mixed-int-string Index to conftest fixtures#65177
Draft
jbrockmendel wants to merge 2 commits intopandas-dev:mainfrom
Draft
TST: add mixed-int-string Index to conftest fixtures#65177jbrockmendel wants to merge 2 commits intopandas-dev:mainfrom
jbrockmendel wants to merge 2 commits intopandas-dev:mainfrom
Conversation
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>
…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>
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.
Summary
"mixed-int-string": Index([0, "a", 1, "b", 2, "c"])toindices_dictin conftest.pysafe_sort_indexfor order-independent comparisons, expectingTypeErrorfor genuinely unsortable operations (argsort, sort_values, searchsorted, numpy min/max), and handlingRuntimeWarningfor unorderable MultiIndex unionTest plan
mixed-int-stringtests now pass🤖 Generated with Claude Code