From 3ada75d15f1e1277e857c84ee5ab10487b67ab58 Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Sat, 6 Mar 2021 12:43:52 +0000 Subject: [PATCH] TYP: remove ignore from makeCustomIndex --- pandas/_testing/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/_testing/__init__.py b/pandas/_testing/__init__.py index 4658aa7e3cfd4..b38ca516c4393 100644 --- a/pandas/_testing/__init__.py +++ b/pandas/_testing/__init__.py @@ -560,7 +560,7 @@ def makeCustomIndex( names = [names] # specific 1D index type requested? - idx_func = { + idx_func_dict: dict[str, Callable[..., Index]] = { "i": makeIntIndex, "f": makeFloatIndex, "s": makeStringIndex, @@ -568,10 +568,10 @@ def makeCustomIndex( "dt": makeDateIndex, "td": makeTimedeltaIndex, "p": makePeriodIndex, - }.get(idx_type) + } + idx_func = idx_func_dict.get(idx_type) if idx_func: - # error: Cannot call function of unknown type - idx = idx_func(nentries) # type: ignore[operator] + idx = idx_func(nentries) # but we need to fill in the name if names: idx.name = names[0]