Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BigQuery select with null values #178

Merged
merged 3 commits into from
Jan 5, 2024
Merged

Conversation

leszko
Copy link
Contributor

@leszko leszko commented Jan 4, 2024

Before this PR, if BigQuery returns null in some of the columns, then a call to /data/views/query returns an error:

"bigquery error: error reading query result: bigquery: NULL cannot be assigned to field PlaytimeMins of type float64"
After this change, it will return the following:

[
    {
        "viewCount": 0,
        "playtimeMins": 0,
        "ttffMs": 0,
        "rebufferRatio": 0,
        "errorRate": 0,
        "exitsBeforeStart": 0
    }
]

Related to https://linear.app/livepeer/issue/PS-191/grafana-engagement-data-issues, though it does no solve the root cause of that issue.

@leszko leszko requested a review from a team as a code owner January 4, 2024 10:46
Copy link

linear bot commented Jan 4, 2024

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (590d298) 28.00000% compared to head (204cf9c) 28.00000%.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##                main        #178   +/-   ##
=============================================
  Coverage   28.00000%   28.00000%           
=============================================
  Files              4           4           
  Lines            325         325           
=============================================
  Hits              91          91           
  Misses           223         223           
  Partials          11          11           
Files Coverage Δ
views/bigquery.go 49.32432% <100.00000%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 590d298...204cf9c. Read the comment docs.

Files Coverage Δ
views/bigquery.go 49.32432% <100.00000%> (ø)

@leszko leszko merged commit 135a56e into main Jan 5, 2024
8 of 13 checks passed
@leszko leszko deleted the rafal/fix-null-bigquery-2 branch January 5, 2024 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants