MeasureReport evaluates its periods together

This commit is contained in:
Roberto Treviño
2026-11-29 06:23:10 -06:00
parent 8b0b121aaa
commit 29186909cc
+3 -2
View File
@@ -385,8 +385,9 @@ def search_measure_report(
raise HTTPException(422, f"reporting-period: {e}") from e
rows = measure_reads.rows(domain.value, found.rows, **found.params)
reports = []
for text, period in _sliced(asked, count, offset):
result = m.evaluate(found, rows, period, as_of, event_cutoff)
page = _sliced(asked, count, offset)
results = m.evaluate_periods(found, rows, [p for _, p in page], as_of, event_cutoff)
for (text, period), result in zip(page, results, strict=True):
report = m.report(found, period, result, as_of)
report.id = f"{f.measure_id(found.id)}-{text.lower()}"
reports.append(report)