We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ef033f commit 22f8ee8Copy full SHA for 22f8ee8
pandas/_testing/__init__.py
@@ -560,18 +560,18 @@ def makeCustomIndex(
560
names = [names]
561
562
# specific 1D index type requested?
563
- idx_func = {
+ idx_func_dict: dict[str, Callable[..., Index]] = {
564
"i": makeIntIndex,
565
"f": makeFloatIndex,
566
"s": makeStringIndex,
567
"u": makeUnicodeIndex,
568
"dt": makeDateIndex,
569
"td": makeTimedeltaIndex,
570
"p": makePeriodIndex,
571
- }.get(idx_type)
+ }
572
+ idx_func = idx_func_dict.get(idx_type)
573
if idx_func:
- # error: Cannot call function of unknown type
574
- idx = idx_func(nentries) # type: ignore[operator]
+ idx = idx_func(nentries)
575
# but we need to fill in the name
576
if names:
577
idx.name = names[0]
0 commit comments