Companion of https://github.com/gem/oq-engine/pull/1298/