Repository navigation
fix(android-ratings): drop 0 'no data' rating that plots as a spike - #29
Conversation
|
…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
|
@greptileai review |
|
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. |
|
Merged by Erik at 15:56 UTC ( |
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.csvhas 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, andupsertcopied it verbatim. The chart forcesylim(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.