Skip to content

feat!: report a missing AQI or pollutant reading as None - #76

Merged
crenshawdev merged 1 commit into
crenshawdev:mainfrom
nwxnw:feat/missing-aqi
Nov 5, 2026
Merged

crenshawdev merged 1 commit into
crenshawdev:mainfrom
nwxnw:feat/missing-aqi

Conversation

@nwxnw

@nwxnw nwxnw commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

The second item in #33, the shape you picked there. A missing AQI is now aqi: None with Unknown in its scale's category, so it no longer reads as Good, and standard() still reports the scale. Missing pollutants are None instead of 0.0.

On the wire, a missing reading is null with the key present, as CONTRACT.md's Option policy already says, and the category is {"standard": "Us", "level": "Unknown"}. Populated payloads don't change: the US and EU snapshots pass untouched, older payloads still parse, and there's one new snapshot for the missing case, quoted in CONTRACT.md.

The tests that asserted the 0/Good fallback now assert None/Unknown, plus one for standard() on Unknown. API.md is updated, and the README example now prints aqi with {:?}.

Closes #33.

@crenshawdev
crenshawdev merged commit 6bde8f1 into crenshawdev:main Nov 5, 2026
3 checks passed
@nwxnw
nwxnw deleted the feat/missing-aqi branch November 5, 2026 21:26
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.

Next breaking release: missing AQI reads as Good, public enums are exhaustive

2 participants