Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/changes/DM-54613.other.rst
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 4 additions & 3 deletions python/lsst/ctrl/bps/generic_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 9 additions & 5 deletions tests/test_generic_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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)
Expand Down
Loading