Skip to content

Commit 22f8ee8

Browse files
TYP: remove ignore from makeCustomIndex (#40270)
1 parent 4ef033f commit 22f8ee8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/_testing/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -560,18 +560,18 @@ def makeCustomIndex(
560560
names = [names]
561561

562562
# specific 1D index type requested?
563-
idx_func = {
563+
idx_func_dict: dict[str, Callable[..., Index]] = {
564564
"i": makeIntIndex,
565565
"f": makeFloatIndex,
566566
"s": makeStringIndex,
567567
"u": makeUnicodeIndex,
568568
"dt": makeDateIndex,
569569
"td": makeTimedeltaIndex,
570570
"p": makePeriodIndex,
571-
}.get(idx_type)
571+
}
572+
idx_func = idx_func_dict.get(idx_type)
572573
if idx_func:
573-
# error: Cannot call function of unknown type
574-
idx = idx_func(nentries) # type: ignore[operator]
574+
idx = idx_func(nentries)
575575
# but we need to fill in the name
576576
if names:
577577
idx.name = names[0]

0 commit comments

Comments
 (0)