Closed CarolineMorton closed 2 years ago
It's worth noting that at present, any string passed as a value in variable_types
property will be used to type the data frame of patient records, whether the string is an "approved" string ("int"
, "categorical"
, "float"
, "binary"
, and "date"
), a nonsense string ("badgers"
), or an alias. This is because cohortreport.processing.type_variables_in_df
doesn't have an else
clause:
However, adding an else
clause wouldn't be the best solution to this issue; type checking should fail fast.
As brought up in #18, when users supply the wrong type to the data - for example, giving the type int to a date - we want to be able to loudly return this typing error back to the user.
The function
type_variables_in_df()
incohortreport.processing
does not raise any errors if it is not able to type correctly. I believe this is where it might be sensible to return something to the user.