Skip to content

Commit

Permalink
Merge pull request #310 from lsst/tickets/DM-46689
Browse files Browse the repository at this point in the history
DM-46689: Check for list index before comparing to previous in pipetask report cli
  • Loading branch information
eigerx authored Oct 7, 2024
2 parents 8a8e908 + 22702c2 commit 213f3f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions doc/changes/DM-46689.bugfix.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 3 additions & 3 deletions python/lsst/ctrl/mpexec/cli/script/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 213f3f6

Please sign in to comment.