Skip to content

BUG: MultiIndex needs to validate length of levels on setting. #4794

@jtratner

Description

@jtratner

related #4687

Bad errors and/or not checking:

>>> ind = tm.makeCustomIndex(5, 5)
>>> ind.set_levels([[1, 2]]) # Wrong Error
Traceback
    ...
ValueError: Length of names (5) must be same as level (1)
>>> ind = tm.makeCustomIndex(5, 5)
>>> ind.set_levels([[1, 2]], inplace=True) # Wrong Error
Traceback
    ...
ValueError: Length of names (5) must be same as level (1)
>>> ind = tm.makeCustomIndex(5, 5)
>>> ind.levels = [[1, 2]] # Wrong Error
Traceback
    ...
ValueError: Length of names (5) must be same as level (1)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions