opensafely-actions / cohort-report

Cohort-report generates a report for each variable in an input file
MIT License
0 stars 0 forks source link

fix: Error on invalid external types #67

Closed iaindillingham closed 2 years ago

iaindillingham commented 2 years ago

When a user passes an "untyped" input file (.csv and .csv.gz) to cohort-report, they must also pass a configuration object called variable_types that maps from names to external types (e.g. binary, categorical, etc.). Previously, invalid external types that were valid internal types (i.e. Pandas types) were permitted; invalid external types that were invalid internal types were not.

This PR ensures that cohort-report now errors on all invalid external types. The errors are also more user-friendly. The commits are in three groups:

BREAKING CHANGE: Cohort-report now errors on all invalid external types.

Fixes #34