@@ -1270,7 +1270,7 @@ def drop_fields(self, names: Union[Collection[str], Callable[[str], bool]], *, c
12701270 Returns:
12711271 Dataset: current dataset or copy with fields removed
12721272 """
1273- test = (lambda n : n not in names ) if isinstance (names , Collection ) else (lambda n : not names (n )) # type: ignore
1273+ test = (lambda n : n not in names ) if isinstance (names , Collection ) else (lambda n : not names (n ))
12741274 return self .filter_fields (test , copy = copy )
12751275
12761276 def rename_fields (self , field_map : Union [Dict [str , str ], Callable [[str ], str ]], * , copy : bool = False ):
@@ -1286,8 +1286,9 @@ def rename_fields(self, field_map: Union[Dict[str, str], Callable[[str], str]],
12861286 Returns:
12871287 Dataset: current dataset or copy with fields renamed
12881288 """
1289+ fm : Callable [[str ], str ]
12891290 if isinstance (field_map , dict ):
1290- fm = lambda x : field_map .get (x , x ) # noqa
1291+ fm = lambda x : field_map .get (x , x ) # noqa: E731
12911292 else :
12921293 fm = field_map
12931294
@@ -1325,7 +1326,7 @@ def rename_prefix(self, old_prefix: str, new_prefix: str, *, copy: bool = False)
13251326 """
13261327 prefix_map = {old_prefix : new_prefix }
13271328
1328- def field_map (name ):
1329+ def field_map (name : str ):
13291330 prefix , base = name .split ("/" )
13301331 return prefix_map .get (prefix , prefix ) + "/" + base
13311332
0 commit comments