if getFiles is called with exists and newest_version both set True, what will be returned is the newest version which exists on disc. If, for some reason, there's an older version (call it 1.2.0) which still exists on disc, and a newer version (say 1.3.0) which does not, this will return version 1.2.0. I would expect it to return nothing: there is no file which is both the newest version and exists.
Obviously this is a pathological case and pretty low in importance, but I wanted to capture it.
Relation to an issue
This was noted in #47 which is closed in #90 without affecting this behavior, so wanted to make sure this was captured.
Again, I think a complete fix to #45 would probably also incorporate this, but I don't want to grab that nettle just yet, so again...making sure it's captured.
Proposed enhancement
Return nothing if there are no files that match conditions which are both newest version and exist on disc.
Alternatives
Best alternative is to fix #45.
We could also proclaim that the newest version must always exist, or at very least that if one exists, it's the latest, and anything else is a database inconsistency.
OS, Python version, and dependency version information:
Current master (5c0082c9c64e0b7c0b244ee168f4e571a19109dd)
Closure condition
This issue should be closed when a PR is merged that has a test where the newest version doesn't exist on disc, an earlier version does, and getFiles returns nothing. And this test passes.
if
getFiles
is called withexists
andnewest_version
both setTrue
, what will be returned is the newest version which exists on disc. If, for some reason, there's an older version (call it 1.2.0) which still exists on disc, and a newer version (say 1.3.0) which does not, this will return version 1.2.0. I would expect it to return nothing: there is no file which is both the newest version and exists.Obviously this is a pathological case and pretty low in importance, but I wanted to capture it.
Relation to an issue
This was noted in #47 which is closed in #90 without affecting this behavior, so wanted to make sure this was captured.
Again, I think a complete fix to #45 would probably also incorporate this, but I don't want to grab that nettle just yet, so again...making sure it's captured.
Proposed enhancement
Return nothing if there are no files that match conditions which are both newest version and exist on disc.
Alternatives
Best alternative is to fix #45.
We could also proclaim that the newest version must always exist, or at very least that if one exists, it's the latest, and anything else is a database inconsistency.
OS, Python version, and dependency version information:
Version of dbprocessing
Current master (5c0082c9c64e0b7c0b244ee168f4e571a19109dd)
Closure condition
This issue should be closed when a PR is merged that has a test where the newest version doesn't exist on disc, an earlier version does, and getFiles returns nothing. And this test passes.