Skip to content

fix(android-ratings): drop 0 'no data' rating that plots as a spike - #29

Merged
ErikBjare merged 3 commits into
ActivityWatch:masterfrom
TimeToBuildBob:bob/fix-zero-rating-spike
Sep 29, 2026
Merged

ErikBjare merged 3 commits into
ActivityWatch:masterfrom
TimeToBuildBob:bob/fix-zero-rating-spike

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Contributor

The Android Play Store rating chart on https://activitywatch.net/stats/ ends with a near-vertical line down to 0 and back up.

Cause: data/android-ratings.csv has a single bogus row, 2026-09-24,0.0, between 3.3999 (09-23) and 3.2884 (09-25). It is the only row outside 1-5 in the file and there are no duplicate dates. Play Console's bulk report evidently emits 0 for "Total Average Rating" on a day with no data, and upsert copied it verbatim. The chart forces ylim(0), so it draws as a spike to the axis.

Changes:

  • android_ratings.py: skip values outside 1-5 when reading the report, so the collector can't re-add it. The daily job upserts from the bucket, so deleting the row alone would not stick.
  • analyze_stats.py: drop non-positive ratings at load time, as a second guard.
  • data/android-ratings.csv: remove the bad row. interpolate(method="time") fills the day.
  • test_android_ratings.py: a small unit test for the validator.

Checked: the CSV has no remaining rows <= 0, the modified files compile, and the new test's assertions pass when called directly. Not checked: I did not regenerate the PNG (matplotlib/pandas not installed here), and I did not confirm that the Play Console bucket really returns 0 for that date, because I have no credentials. The site picks up the fix at its next rebuild, which regenerates img/stats/android-rating.png.

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Filters out placeholder zero ratings from Android app metrics.

The PR appears safe to merge; the previously noted collection-path test gap is fixed.

Findings

  1. P2 Collection path remains untested ▶

Summary

The PR removes a zero-rating row from the Android ratings data and filters invalid ratings during collection and chart loading. The follow-up commit adds a collection-path test for the filter and adjusts a CSV test to read stdout.

Reviews (2) · Last reviewed commit: "test(android-ratings): cover fetch path ..."

Comment thread test_android_ratings.py
…rtion

CliRunner.output mixes stdout and stderr by default. The stale-feed WARNING
is correctly printed to stderr (err=True) but was contaminating the CSV
parser because the test read result.output. Use result.stdout instead.

Git-Session-Id: 5e2c
Greptile 4/5 on ActivityWatch#29: the validator unit test would still
pass if fetch_rating_series stopped applying the filter. Mock the report
download and assert 0.0/garbage never enter the series.

Git-Session-Id: 7b774fe3-8be7-5667-8bd9-ea33121fd65e
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

@greptileai review

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

Greptile 5/5 at fbe88ea (collection-path test covered). CI green.

Self-merge not eligible here (cross-repo / policy gate). Waiting for human review or merge.

@ErikBjare
ErikBjare merged commit 52c4710 into ActivityWatch:master Sep 29, 2026
2 checks passed
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

Merged by Erik at 15:56 UTC (52c4710b). Post-merge verification: the fix is live on master — data/android-ratings.csv no longer contains the 2026-09-24,0.0 placeholder (rows run 09-23 → 09-25), and the collector + analysis guards are in the merged tree. The /stats/ chart regenerates on the site's next build. No further action from me.

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