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-32964: SimplePipelineExecutor should validate and freeze the config #219

Merged
merged 1 commit into from
Dec 14, 2021
Merged
Changes from all commits
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
11 changes: 5 additions & 6 deletions python/lsst/pipe/base/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ def __init__(self, taskName=None, config=None, taskClass=None, label=None):
raise ValueError("`taskClass` must be provided if `label` is not.")
label = taskClass._DefaultName
self.taskName = taskName
try:
config.validate()
except Exception:
_LOG.error("Configuration validation failed for task %s (%s)", label, taskName)
raise
config.freeze()
self.config = config
self.taskClass = taskClass
Expand Down Expand Up @@ -640,12 +645,6 @@ def _buildTaskDef(self, label: str) -> TaskDef:
for key, value in configIR.rest.items():
overrides.addValueOverride(key, value)
overrides.applyTo(config)
# This may need to be revisited
try:
config.validate()
except Exception:
_LOG.error("Configuration validation failed for task %s (%s)", label, taskName)
raise
return TaskDef(taskName=taskName, config=config, taskClass=taskClass, label=label)

def __iter__(self) -> Generator[TaskDef, None, None]:
Expand Down