diff --git a/doc/changes/DM-46689.bugfix.md b/doc/changes/DM-46689.bugfix.md new file mode 100644 index 00000000..b801064f --- /dev/null +++ b/doc/changes/DM-46689.bugfix.md @@ -0,0 +1,3 @@ +Compare timestamps properly between two graphs when using pipetask report on multiple graphs. + +(The bug was looping back to say the "previous" graph was the end of the list when "count" was 0). Also fix the wording in the associated RuntimeError. \ No newline at end of file diff --git a/python/lsst/ctrl/mpexec/cli/script/report.py b/python/lsst/ctrl/mpexec/cli/script/report.py index 62d88e79..481d0eb0 100644 --- a/python/lsst/ctrl/mpexec/cli/script/report.py +++ b/python/lsst/ctrl/mpexec/cli/script/report.py @@ -180,14 +180,14 @@ def report_v2( for count, qgraph in enumerate(qgraphs): if len(qgraphs) > 1: previous_graph = qgraphs[count - 1] - if qgraph.metadata["time"] < previous_graph.metadata["time"]: + if count > 0 and qgraph.metadata["time"] < previous_graph.metadata["time"]: raise RuntimeError( f"""add_new_graph may only be called on graphs which are passed in the order they were created. Please call again, passing your - graphs in order. Time of first graph: + graphs in order. Time of second graph: {qgraph.metadata["time"]} > - time of second graph: {previous_graph.metadata["time"]}""" + time of first graph: {previous_graph.metadata["time"]}""" ) qpg.assemble_quantum_provenance_graph(butler, qgraphs, collections, where, curse_failed_logs) summary = qpg.to_summary(butler, do_store_logs=logs)