Repository navigation
fix: report no MV delta days as NULL in the freshness endpoint - #5528
Conversation
min() and max() of an empty snapshot MV return 1970-01-01, which read as a catch-up window back to the epoch when there is nothing to catch up from. Refs linuxfoundation/lfx-cdp-insights-ops#1182 Signed-off-by: Uroš Marolt <uros@marolt.me>
PR SummaryLow Risk Overview The pipe now uses Reviewed by Cursor Bugbot for commit 5fc981a. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
@themarolt I'm starting review 1 of this pull request now (started 2026-12-05 20:28 UTC using review agent v0.1.37). This usually takes a few minutes. I'll update this comment with the summary when I'm done. If there's no summary here after about 45 minutes, the review stopped: push a new commit, or post a comment that begins with a mention of me followed by Hi Uros Marolt (@themarolt), SummaryThis pull request makes the two MV bound columns in the served-layer freshness pipe return NULL on an empty MV, instead of Decision✅ Approved DetailsOverall impression: One-file change to Documentation reminder: changed Rule files: read Questions, problems, or feedback: https://github.com/linuxfoundation/lfx-review-agent/issues |
lfx-one
left a comment
There was a problem hiding this comment.
The change is small and correct: minOrNull/maxOrNull make the two MV bounds NULL on an empty MV instead of 1970-01-01, and the pipe description documents it. No findings.
Documentation
This pull request changes behavior that may also be described outside this repository, such as product pages or an external docs site. I can't read those, so please check them; the author and maintainers own those updates. Changed here:
mvOldestSnapshotIdandmvNewestSnapshotId(now NULL when the MV is empty, instead of1970-01-01)
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the change to return NULL freshness bounds when the delta store is empty.
No open issues 🎉
What changed in this PR
Corrects the Tinybird served-layer freshness endpoint so an empty delta store reports NULL bounds instead of misleading epoch dates.
Changes:
- Replaces
min/maxwithminOrNull/maxOrNull. - Documents the empty-store behavior without changing the output schema.
| File | Description |
|---|---|
| services/libs/tinybird/pipes/monitoring_served_layer_freshness.pipe | Returns nullable delta bounds and clarifies their meaning when empty. |
Review effort: Balanced
Confidence Score: 5/5
[Low impact] This PR appears safe to merge. SummaryUpdates
Reviews (1) · Last reviewed commit: "fix: report no MV delta days as NULL in ..." · Reviewed by Greptile |
Summary
Follow-up to #5527 (Cursor Bugbot finding). On an empty
activityRelations_enrich_snapshot_MV_ds,min(snapshotId)andmax(snapshotId)return1970-01-01, somvOldestSnapshotId/mvNewestSnapshotIdwould show a catch-up window back to the epoch exactly when a missed merge has nothing left to recover from. They now come back NULL.Changes
minOrNull/maxOrNullfor the two MV bounds inmonitoring_served_layer_freshness.pipe; the description says they are NULL when the MV is empty.Checked read-only on production: on an empty input
min()returns1970-01-01andminOrNull()NULL; on today's MV both return 2026-12-05 / 2026-12-06. The columns were alreadyNullable(DateTime), so the output shape does not change.Deploy
tb push services/libs/tinybird/pipes/monitoring_served_layer_freshness.pipe --forceafter merge.Type of change
Related issue
Refs linuxfoundation/lfx-cdp-insights-ops#1182