Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-33569: Report all missing dataset types #169

Merged
merged 2 commits into from
Feb 10, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 11 additions & 5 deletions python/lsst/ctrl/mpexec/preExecInit.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def _check_compatibility(datasetType, expected, is_input) -> bool:
)
return is_compatible

missing_datasetTypes = set()
for datasetType in datasetTypes:
# Only composites are registered, no components, and by this point
# the composite should already exist.
Expand All @@ -199,17 +200,22 @@ def _check_compatibility(datasetType, expected, is_input) -> bool:
expected = self.butler.registry.getDatasetType(datasetType.name)
except KeyError:
# Likely means that --register-dataset-types is forgotten.
raise KeyError(
f"Dataset type with name '{datasetType.name}' not found. Dataset types "
"have to be registered with either `butler register-dataset-type` or "
"passing `--register-dataset-types` option to `pipetask run`."
) from None
missing_datasetTypes.add(datasetType.name)
continue
if expected != datasetType:
if not _check_compatibility(datasetType, expected, is_input):
raise ValueError(
f"DatasetType configuration does not match Registry: {datasetType} != {expected}"
)

if missing_datasetTypes:
plural = "s" if len(missing_datasetTypes) != 1 else ""
raise KeyError(
f"Missing dataset type definition{plural}: {', '.join(missing_datasetTypes)}. "
"Dataset types have to be registered with either `butler register-dataset-type` or "
"passing `--register-dataset-types` option to `pipetask run`."
)

def saveInitOutputs(self, graph):
"""Write any datasets produced by initializing tasks in a graph.

Expand Down