opensafely-actions / cohort-report

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

add more options to test suppress low numbers #31

Closed CarolineMorton closed 2 years ago

CarolineMorton commented 2 years ago

Closes #17

This adds more options to the tests that check suppress low numbers. In particular, it checks low number suppression for binary, categorical and dates.

A further issue that came up was how to deal with Series of Python objects. These could be string objects and in fact, if you pass in strings into a series without specifying dtype to category, these are identified as objects.

My concern is that we don't want to assume that all objects are strings (what for example, if they were other python objects like a data structure). The desired behaviour I want is that any series with dtype of object are redacted and an empty series is outputted. I have checked this behaviour with a test.

Note that, this behaviour was already taking place with the code we have and only the test is new.