I am currently trying to get my python code to be compatible to PEP8. For the following code pylint tells me that the type_list variable in filter_not is problematic because it is never used. While this is of course true I am not sure how to fix this. Is there a better way to do this or is this just a false positive?
Note that the code below is just an extract. There are actually far more functions in there which the switcher_filter handles. So an regular if statement would get far to big. Also I am not using an enum for the switcher option as the main function is called from outside and I do not want to import the enum into every file calling the module.
def filter_by_x(df_input, type_list):
return df_input[lambda df: df["x"].isin(type_list)]
def filter_not(df_input, type_list):
return df_input
switcher_filter = {
'not': filter_not(removed_duplicates_df, type_list),
'x': filter_by_x(removed_duplicates_df, type_list)
filtered_df = switcher_filter.get(filterby)
}