Description
Currently, the archive utility is integrated into run_module()
. This is problematic, because if the CSV output fails validation (either after delivery to the server, or during the imminent validation step) then we wind up saving files to the cache that do not actually reflect what data is in the API.
This is actively causing problems for #179, and could affect every indicator where the archiver is used in this way as soon as it fails ingestion once.
Once the validator is available, we will want to shift archiver duties to occur only after validation succeeds.
To prepare for that, we should adapt the archiver to run independently via the delphi_utils
module. Something like
(env) $ python -m delphi_utils archive
-- the archive
command will leave room for other utils commands should they come up.
This has the bonus of decoupling archiver code from the indicator implementations, reducing duplication, and making it easier to run indicators in development environments without needing S3 credentials.