view-job-records
: accept multiple timestamp formats for after-start-time
, before-end-time
optional args
#567
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The
--after-start-time
and--before-end-time
optional args for theview-job-records
command only takes one format: a seconds-since-epoch timestamp, which isn't super user friendly.This PR makes use of the
flux.util.parse_datetime()
function to accept multiple, more human-readable format strings as values to the--after-start-time
and--before-end-time
optional args.It adds a helper function to
jobs_table_subcommands
to perform the parsing of the timestamp. If parsing the timestamp string fails, it just attempts to pass it as a seconds-since-epoch timestamp to the SQLite query (which will return no job records if the timestamp is invalid).I've also updated the help description to both of the optional arguments to provide examples of human-readable formats as well as added some basic sharness tests that pass different timestamp formats to the flux-accounting job-archive.
Fixes #565