From 2f4cd051849bfa1d4b9e0347f01d18f21f8d1ab3 Mon Sep 17 00:00:00 2001 From: Mikolaj Kowalik Date: Thu, 16 Apr 2026 14:55:42 -0400 Subject: [PATCH 1/3] Do not throw if labels were not used in a group --- python/lsst/ctrl/bps/generic_workflow.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/lsst/ctrl/bps/generic_workflow.py b/python/lsst/ctrl/bps/generic_workflow.py index 65889d95..c3c583bc 100644 --- a/python/lsst/ctrl/bps/generic_workflow.py +++ b/python/lsst/ctrl/bps/generic_workflow.py @@ -990,9 +990,10 @@ def _check_job_ordering_config(self, ordering_config: dict[str, Any]) -> dict[st if unused_labels: _LOG.info("Workflow job labels = %s", ",".join(self._job_labels.labels)) - raise RuntimeError( - f"Job label(s) ({','.join(unused_labels)}) from job ordering group " - f"{group} does not exist in workflow. Aborting." + _LOG.warning( + "Job label(s) (%s) from job ordering group %s does not exist in workflow.", + ",".join(unused_labels), + group, ) label_subgraph = self._job_labels.subgraph(job_labels) From 5c1fc34e812ea83c0b4bdc2141d0174296d804e2 Mon Sep 17 00:00:00 2001 From: Mikolaj Kowalik Date: Mon, 20 Apr 2026 07:11:04 -0400 Subject: [PATCH 2/3] Modify unit tests to reflect the changes --- tests/test_generic_workflow.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/test_generic_workflow.py b/tests/test_generic_workflow.py index 13cb37e2..a48f951e 100644 --- a/tests/test_generic_workflow.py +++ b/tests/test_generic_workflow.py @@ -451,11 +451,7 @@ def testCheckJobOrderingConfigBadLabel(self): def testCheckJobOrderingConfigUnusedLabel(self): gwf = gtu.make_3_label_workflow("test_unused_label", final=True) - with self.assertRaisesRegex( - RuntimeError, - r"Job label\(s\) \(unused1,unused2\) from job ordering group " - "order1 does not exist in workflow. Aborting.", - ): + with self.assertLogs("lsst.ctrl.bps.generic_workflow", level=logging.WARNING) as cm: gwf._check_job_ordering_config( { "order1": { @@ -465,6 +461,14 @@ def testCheckJobOrderingConfigUnusedLabel(self): }, } ) + self.assertTrue( + any( + "Job label(s) (unused1,unused2) from job ordering group order1 does not exist in workflow." + in record.getMessage() + for record in cm.records + ), + "Expected warning about unused labels", + ) def testCheckJobOrderingConfigMissingDim(self): gwf = gtu.make_3_label_workflow("test_missing_dim", final=True) From eba1fd79c3fa012fffee6694f03bc6ff8f4b0c0f Mon Sep 17 00:00:00 2001 From: Mikolaj Kowalik Date: Mon, 20 Apr 2026 07:12:58 -0400 Subject: [PATCH 3/3] Add a news item describing the changes --- doc/changes/DM-54613.other.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 doc/changes/DM-54613.other.rst diff --git a/doc/changes/DM-54613.other.rst b/doc/changes/DM-54613.other.rst new file mode 100644 index 00000000..9e45c6ac --- /dev/null +++ b/doc/changes/DM-54613.other.rst @@ -0,0 +1,2 @@ +Changed BPS behavior so it doesn't throw when there are job labels in job ordering groups that were not included in the final version of the workflow. +From now on BPS will only warn the user when it occures.