diff --git a/doc/changes/DM-54084.bugfix.md b/doc/changes/DM-54084.bugfix.md new file mode 100644 index 000000000..c3def38ad --- /dev/null +++ b/doc/changes/DM-54084.bugfix.md @@ -0,0 +1 @@ +Fix a bug in `butler provenance-report` that caused an exception to be raised when trying to print an empty table. diff --git a/python/lsst/pipe/base/quantum_graph/_provenance.py b/python/lsst/pipe/base/quantum_graph/_provenance.py index 62603a3f2..79fd96888 100644 --- a/python/lsst/pipe/base/quantum_graph/_provenance.py +++ b/python/lsst/pipe/base/quantum_graph/_provenance.py @@ -1602,12 +1602,14 @@ def make_many_reports( stream.write(status_report.model_dump_json(indent=2)) if print_quantum_table: quantum_table = self.make_quantum_table() - quantum_table.pprint_all() - print("") + if quantum_table: + quantum_table.pprint_all() + print("") if print_exception_table: exception_table = self.make_exception_table() - exception_table.pprint_all() - print("") + if exception_table: + exception_table.pprint_all() + print("") @dataclasses.dataclass