Here is the code. For some reason, if I have type_of_model, neitehr X, nor Y exception does not work. The exception does not appear.
`def preprocess_corresponds_to_model(type_of_model: str) -> function:
try:
if type_of_model == "X":
preprocessing_function = preprocess_location_df
return preprocessing_function
elif type_of_model == "Y":
preprocessing_function = preprocess_event_df
return preprocessing_function
except FileNotFoundError as exception:
raise Exception(
f"The model {type_of_model} does not exist."
"The model should be either X or Y"
) from exception`
I expect that when as an input parameter I have neither X, nor Y I will see an exception message and my python script will be interrupted. But nothing happens.