You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d7e9a7d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(gooddata-eval): guard out-of-range date offsets and share one scoring anchor
Two defects in relative-date scoring, both found in review of this PR.
An offset far enough out to leave the representable date range raised out of
_absolute_span instead of resolving. Every granularity can be pushed past it: a
YEAR offset of -today.year lands on year 0, large DAY/WEEK_US offsets exceed
timedelta's magnitude limit, and large MONTH/QUARTER offsets leave 1..9999. The
exception escaped through _normalize_date_filter and check_filters, failing the
whole item over one malformed filter. It now resolves to None, putting the
filter back on the literal-comparison path an unresolvable span already takes.
Separately, check_filters shared one anchor across its two sides, but the
evaluator resolved the filters it reports through separate normalized_filters
calls, each taking its own date.today(). A run straddling midnight could report
periods the verdict was never computed from -- a detail contradicting its own
score. The anchor is now captured once in _evaluate_visualization and passed to
check_filters and both normalized_filters calls; _evaluate_against_candidates
captures one too, so candidates are never ranked on spans from different days.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments