From fa2bc968200711b0e6d40b671aa7486282b1d2a7 Mon Sep 17 00:00:00 2001 From: Jim Bosch Date: Mon, 11 Nov 2024 10:36:24 -0500 Subject: [PATCH] Don't raise when --dataset-query-constraint args are irrelevant. They might be relevant for a different subgraph, and this option needs to be usable on multi-subgraph pipelines where the subgraphs don't have overall inputs in common. --- doc/changes/DM-47505.misc.md | 1 + .../pipe/base/all_dimensions_quantum_graph_builder.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 doc/changes/DM-47505.misc.md diff --git a/doc/changes/DM-47505.misc.md b/doc/changes/DM-47505.misc.md new file mode 100644 index 000000000..79f9cdda6 --- /dev/null +++ b/doc/changes/DM-47505.misc.md @@ -0,0 +1 @@ +QuantumGraph generation will no longer fail when the `--dataset-query-constraint` argument includes a dataset type that is not relevant for one or more pipeline subgraphs. diff --git a/python/lsst/pipe/base/all_dimensions_quantum_graph_builder.py b/python/lsst/pipe/base/all_dimensions_quantum_graph_builder.py index 23c1ce1cd..3c61505c3 100644 --- a/python/lsst/pipe/base/all_dimensions_quantum_graph_builder.py +++ b/python/lsst/pipe/base/all_dimensions_quantum_graph_builder.py @@ -479,10 +479,10 @@ def from_builder( constraint = set(builder.dataset_query_constraint) inputs = result.overall_inputs - result.empty_dimensions_dataset_types.keys() if remainder := constraint.difference(inputs): - raise QuantumGraphBuilderError( - f"{remainder} dataset type(s) specified as a graph constraint, but" - f" do not appear as an overall input to the specified pipeline: {inputs}." - " Note that component datasets are not permitted as constraints." + builder.log.debug( + "Ignoring dataset types %s in dataset query constraint that are not inputs to this " + "subgraph, on the assumption that they are relevant for a different subraph.", + remainder, ) builder.log.debug(f"Constraining graph query using {constraint}") result.query_args["datasets"] = constraint