From 9bc1075632b4d170684bbf7438142480239bdbd6 Mon Sep 17 00:00:00 2001 From: Jim Bosch Date: Mon, 9 Feb 2026 10:31:22 -0500 Subject: [PATCH] Don't try to print empty report tables. That causes a confusing exception to be raised from deep within Astropy. --- doc/changes/DM-54084.bugfix.md | 1 + python/lsst/pipe/base/quantum_graph/_provenance.py | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 doc/changes/DM-54084.bugfix.md 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