fix: drop empty APR timeseries buckets#403
Open
matheus1lva wants to merge 1 commit into
Open
Conversation
Treat zero APR samples as missing during aggregation and exclude buckets that contain no non-zero values. This prevents indexer downtime gaps from being served as zero-value interior datapoints in yvUSD APR charts.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes bad zero/empty interior APR datapoints by dropping aggregate buckets that contain no non-zero samples. The existing SQL already treated zero values as missing with
NULLIF; this removes theCOALESCEfallback that converted fully empty buckets back into chart-visible zeroes.How to review
packages/web/app/api/gql/resolvers/timeseries.tsandpackages/web/app/api/rest/timeseries/db.ts.Local/staging setup notes
POSTGRES_*env vars to point to the read-only replica.Test plan
netAPRGraphQL curl.netAPRvalidation. Expected result: output showszeroRows: 0,nonNumericRows: 0,unordered: 0, androwsgreater than0if DB has the affected series.netAPRvalidation. Expected result: output showszeroRows: 0and printsmin/max. Any remaining non-zero wiggle is source/provider behavior, not this SQL fallback.netAPR. Expected result: local branch has no zero rows; production may still show zero rows until this PR deploys and cache refresh runs.open "$API_ORIGIN"git diff --check # Expected: no output, exit code 0Risk / impact
0.NULLIF(value, 0), which already treated zeros as missing samples.EOF 2>&1