Open spacesphere opened 6 years ago
@PoppyBagel : Thanks for reporting this! Perhaps the name is a little misleading, as you're indeed correct that we don't just validate. Maybe a name like "_parse_names" might be more appropriate. Feel free to propose another name in a PR if you like.
Probably becomes simpler once #44916 is enforced.
Currently
Index._validate_names()
does not only validation, but some other unrelated to validation stuff:https://github.com/pandas-dev/pandas/blob/055bfa6a2a4ef81d6a0c41c6f870dbe0ec5296d3/pandas/core/indexes/base.py#L803-L820
Moreover, it's closely tied in with copying logic without any reason, so that
_validate_names()
cannot be used in other cases. I think it would be reasonable to separate these responsibilities.