Skip to content

Fix parsing the vaccination data #1805

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

Merged
merged 1 commit into from
Aug 27, 2021
Merged

Conversation

jepler
Copy link
Contributor

@jepler jepler commented Aug 26, 2021

The code apparently broke when a new column was added to the CSV data to show the number of boosters. This field is blank in the US data, so the code would crash trying to turn the empty string into an integer.

Since upstream seems to add columns at the far right (a sensible choice) we should index using positive numbers instead.

This also changes the code so that in the event of a failure it actually DOES retry. I designed it to wait for 1 hour in deep sleep before retrying, so that it doesn't immediately run down the battery in case of transient errors.

Note that if you test this code with version 7 prereleases at least up to beta.0, you may be affected by a CircuitPython bug:

this bug can cause a very inconvenient boot loop.

The code apparently broke when a new column was added to the CSV
data to show the number of boosters.  This field is blank in the US
data, so the code would crash trying to turn the empty string into an
integer.

Since upstream seems to add columns at the far right (a sensible
choice) we should index using positive numbers instead.

This also changes the code so that in the event of a failure it actually
*DOES* retry. I designed it to wait for 1 hour in deep sleep before retrying,
so that it doesn't immediately run down the battery in case of transient
errors.
@jepler jepler requested a review from TheKitty August 27, 2021 19:12
@TheKitty TheKitty merged commit e19f6e8 into adafruit:main Aug 27, 2021
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