Skip to content

TST: mixed_int_string Index #54072

Open
Open
@jbrockmendel

Description

@jbrockmendel
Member

Adding in conftest's indices_dict an entry:

"mixed-int-string": Index([0, "a", 1, "b", 2, "c"])

broke a bunch of tests the last time I checked. We should add an entry like this and fix the tests it breaks and/or bugs it surfaces.

Activity

added
Testingpandas testing functions or related to the test suite
IndexRelated to the Index class or subclasses
and removed
Needs TriageIssue that has not been reviewed by a pandas team member
on Jul 11, 2023
lithomas1

lithomas1 commented on Jul 11, 2023

@lithomas1
Contributor

I'll tag this as a good first issue as adding the tests doesn't seem too hard.

pandas/pandas/conftest.py

Lines 595 to 628 in b4929f8

indices_dict = {
"string": tm.makeStringIndex(100),
"datetime": tm.makeDateIndex(100),
"datetime-tz": tm.makeDateIndex(100, tz="US/Pacific"),
"period": tm.makePeriodIndex(100),
"timedelta": tm.makeTimedeltaIndex(100),
"range": tm.makeRangeIndex(100),
"int8": tm.makeIntIndex(100, dtype="int8"),
"int16": tm.makeIntIndex(100, dtype="int16"),
"int32": tm.makeIntIndex(100, dtype="int32"),
"int64": tm.makeIntIndex(100, dtype="int64"),
"uint8": tm.makeUIntIndex(100, dtype="uint8"),
"uint16": tm.makeUIntIndex(100, dtype="uint16"),
"uint32": tm.makeUIntIndex(100, dtype="uint32"),
"uint64": tm.makeUIntIndex(100, dtype="uint64"),
"float32": tm.makeFloatIndex(100, dtype="float32"),
"float64": tm.makeFloatIndex(100, dtype="float64"),
"bool-object": tm.makeBoolIndex(10).astype(object),
"bool-dtype": Index(np.random.randn(10) < 0),
"complex64": tm.makeNumericIndex(100, dtype="float64").astype("complex64"),
"complex128": tm.makeNumericIndex(100, dtype="float64").astype("complex128"),
"categorical": tm.makeCategoricalIndex(100),
"interval": tm.makeIntervalIndex(100),
"empty": Index([]),
"tuples": MultiIndex.from_tuples(zip(["foo", "bar", "baz"], [1, 2, 3])),
"mi-with-dt64tz-level": _create_mi_with_dt64tz_level(),
"multi": _create_multiindex(),
"repeats": Index([0, 0, 1, 1, 2, 2]),
"nullable_int": Index(np.arange(100), dtype="Int64"),
"nullable_uint": Index(np.arange(100), dtype="UInt16"),
"nullable_float": Index(np.arange(100), dtype="Float32"),
"nullable_bool": Index(np.arange(100).astype(bool), dtype="boolean"),
"string-python": Index(pd.array(tm.makeStringIndex(100), dtype="string[python]")),
}
is where you should start.

A word of caution, though:
This can get annoying/hard fast depending on how many tests fail.

SanjithChockan

SanjithChockan commented on Jul 11, 2023

@SanjithChockan
Contributor

take

segwhat

segwhat commented on Jul 12, 2023

@segwhat

@SanjithChockan how's it going?

PurnashisHazra

PurnashisHazra commented on Jul 12, 2023

@PurnashisHazra

Can I take this up?

PurnashisHazra

PurnashisHazra commented on Jul 12, 2023

@PurnashisHazra

take

removed their assignment
on Jul 12, 2023

16 remaining items

removed their assignment
on Sep 11, 2024
brandonmonge

brandonmonge commented on Nov 6, 2024

@brandonmonge

take

removed their assignment
on Dec 3, 2024
yoav-edelist

yoav-edelist commented on Dec 14, 2024

@yoav-edelist

take

pelagiavlas

pelagiavlas commented on Mar 22, 2025

@pelagiavlas

Hi! can i take this?

xaris96

xaris96 commented on Mar 23, 2025

@xaris96

take

spd123

spd123 commented on Apr 21, 2025

@spd123

I'm a new contributor to this project. Can I take this one if nobody is working currently?

spd123

spd123 commented on Apr 22, 2025

@spd123

I see a lot of (100+) tests are breaking with this change. Are we expected to fix the test cases or the functions are using this type of Index value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

IndexRelated to the Index class or subclassesTestingpandas testing functions or related to the test suite

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @jbrockmendel@mroeschke@josephwillard@Pranav-Wadhwa@gabriale99

    Issue actions

      TST: mixed_int_string Index · Issue #54072 · pandas-dev/pandas