Skip to content

Commit 85232cc

Browse files
enourbakhshtimj
authored andcommitted
Reuse exception diagnostics table if already available
1 parent f6f6b73 commit 85232cc

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

python/lsst/ctrl/mpexec/cli/script/report.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,11 @@ def print_summary(
371371
Butler to use for the report. This is needed to get the exposure
372372
dimension records for the exception diagnostics.
373373
"""
374-
summary.pprint(
374+
exception_diagnostics_table = summary.pprint(
375375
brief=(brief or bool(full_output_filename) or bool(exception_diagnostics_filename)),
376376
show_exception_diagnostics=show_exception_diagnostics,
377377
butler=butler,
378+
return_exception_diagnostics_table=show_exception_diagnostics and exception_diagnostics_filename,
378379
)
379380
if full_output_filename:
380381
# Write the full summary to a file.
@@ -383,7 +384,10 @@ def print_summary(
383384
print(f"Full summary written to {full_output_filename}")
384385

385386
if exception_diagnostics_filename:
386-
exception_diagnostics_table = summary.make_exception_diagnostics_table(butler)
387+
# Create the exception diagnostics table if it wasn't created in the
388+
# previous step due to `show_exception_diagnostics` being False.
389+
if not exception_diagnostics_table:
390+
exception_diagnostics_table = summary.make_exception_diagnostics_table(butler)
387391

388392
# Check the file extension to determine the format.
389393
fmt = infer_write_format_from_filename(exception_diagnostics_filename)

0 commit comments

Comments
 (0)