Quitar el corte de periodo de las medidas

This commit is contained in:
2026-12-03 22:21:59 -06:00
parent 663d384032
commit fb2f3c1753
2 changed files with 2 additions and 54 deletions
+2 -7
View File
@@ -6,7 +6,7 @@ counting a few thousand rows (measures) and ordering the follow-up list."""
import operator
import os
import unicodedata
from datetime import date, datetime, timedelta
from datetime import date, datetime
from typing import Annotated, Any
from dagster_graphql import DagsterGraphQLClient
@@ -540,9 +540,6 @@ def search_measure_report(
event_cutoff: date | None = Query(
None, alias="event-cutoff", description="durations count to this day"
),
period_cutoff: date | None = Query(
None, alias="period-cutoff", description="Include period events through this day"
),
_count: int | None = Query(None),
_offset: int = Query(0),
) -> Response:
@@ -556,9 +553,7 @@ def search_measure_report(
rows = measure_reads.rows(domain.value, found.rows, **found.params)
reports = []
page = _sliced(asked, count, offset)
evaluated = [m.Period(p.start, min(p.end, period_cutoff + timedelta(days=1)))
if period_cutoff and period_cutoff < date.max else p for _, p in page]
results = m.evaluate_periods(found, rows, evaluated, as_of, event_cutoff)
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()}"