For the current state of the code, this change is not required. It will, however, save someone fixing this in future, when actually wanting to use a newer OpenSAFELY Python image.
However, the tests currently rely on a quirky behaviour of .all() in pandas that has been fixed.
In the version of pandas inside the python:latest image (v1.0.1), the behaviour is that .all() can return an dtype=object instead of a Boolean, and our tests as written pass.
In later versions of pandas, .all() returns a Boolean instead, and our tests fail.
We can rewrite the tests to work both prior to and post this pandas fix.
This was checked by running the tests with the Dockerfile as provided, and editing the Dockerfile to use the v2 OpenSAFELY Python image.
For the current state of the code, this change is not required. It will, however, save someone fixing this in future, when actually wanting to use a newer OpenSAFELY Python image.
However, the tests currently rely on a quirky behaviour of
.all()
in pandas that has been fixed.In the version of pandas inside the
python:latest
image (v1.0.1), the behaviour is that.all()
can return andtype=object
instead of a Boolean, and our tests as written pass.In later versions of pandas,
.all()
returns a Boolean instead, and our tests fail.We can rewrite the tests to work both prior to and post this pandas fix.
This was checked by running the tests with the
Dockerfile
as provided, and editing theDockerfile
to use thev2
OpenSAFELY Python image.See pandas-dev/pandas#12863.