Skip to content

Commit fe07d18

Browse files
committed
CLN: Remove redundant checks for NA, NaT, and NaN in Index class
1 parent 3df788a commit fe07d18

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

pandas/core/indexes/base.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
)
2727

2828
from pandas._libs import (
29-
NA,
3029
NaT,
3130
algos as libalgos,
3231
index as libindex,
@@ -2097,19 +2096,6 @@ def _validate_index_level(self, level) -> None:
20972096
)
20982097

20992098
else:
2100-
if level is NA:
2101-
raise KeyError(
2102-
"Requested level is pandas.NA, which is not a valid index name"
2103-
)
2104-
if level is NaT:
2105-
raise KeyError(
2106-
"Requested level is pandas.NaT, which is not a valid index name"
2107-
)
2108-
if isinstance(level, float) and np.isnan(level):
2109-
raise KeyError(
2110-
"Requested level is NaN, which is not a valid index name"
2111-
)
2112-
21132099
if level != self.name:
21142100
raise KeyError(
21152101
f"Requested level ({level}) does not match index name ({self.name})"

0 commit comments

Comments
 (0)