in lib/metric-config-parser/metric_config_parser/analysis.py [0:0]
def merge_outcome(self, other: "OutcomeSpec"):
"""Merges an outcome snippet into the analysis spec."""
metrics = [MetricReference(metric_name) for metric_name, _ in other.metrics.items()]
# metrics defined in outcome snippets are only computed for
# weekly and overall analysis windows
outcome_spec = MetricsSpec(
daily=[],
weekly=metrics,
days28=[],
overall=metrics,
definitions=other.metrics,
)
outcome_spec.merge(self.metrics)
other.data_sources.merge(self.data_sources)
self.data_sources = other.data_sources
self.metrics = outcome_spec
if other.parameters:
self.merge_parameters(other.parameters)