feat(North Northamptonshire): food caddy bin type in calendar scraper#1894
feat(North Northamptonshire): food caddy bin type in calendar scraper#1894dweee wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughCouncil parser updated to classify bin titles containing "food" or "caddy" (case-insensitive) as type "Food Caddy" instead of falling through to "Unknown". Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
uk_bin_collection/uk_bin_collection/councils/NorthNorthamptonshireCouncil.py (1)
55-64: Prefer fail-fast over silent"Unknown"classification in parser logic.Consider raising on unmatched titles instead of defaulting to
"Unknown"so upstream format changes are detected immediately.Suggested refactor
elif "refuse" in sov: bin_type = "General" else: - bin_type = "Unknown" + raise ValueError(f"Unrecognized bin title format: {output_json[i]['title']}")Based on learnings: In
uk_bin_collection/**/*.py, parsing should prefer explicit failures over silent defaults to catch format drift early.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@uk_bin_collection/uk_bin_collection/councils/NorthNorthamptonshireCouncil.py` around lines 55 - 64, The parser currently falls back to bin_type = "Unknown" when a schedule title in variable sov doesn't match known patterns; replace that silent default with a fail-fast exception (e.g., raise ValueError) inside the same parsing block in NorthNorthamptonshireCouncil (where sov and bin_type are set) so any unmatched sov values immediately surface; include sov (and any contextual identifier available) in the exception message to aid debugging and detect upstream format changes early.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@uk_bin_collection/uk_bin_collection/councils/NorthNorthamptonshireCouncil.py`:
- Around line 59-60: The branch in NorthNorthamptonshireCouncil that sets
bin_type uses the non-canonical string "Food caddy", causing key-mismatch with
existing mappings; update the assignment in the elif "food" in sov or "caddy" in
sov branch to use the canonical label "Food Caddy" (i.e., set bin_type = "Food
Caddy") so it matches other council parsers and existing icon/color lookups for
the bin_type variable.
---
Nitpick comments:
In
`@uk_bin_collection/uk_bin_collection/councils/NorthNorthamptonshireCouncil.py`:
- Around line 55-64: The parser currently falls back to bin_type = "Unknown"
when a schedule title in variable sov doesn't match known patterns; replace that
silent default with a fail-fast exception (e.g., raise ValueError) inside the
same parsing block in NorthNorthamptonshireCouncil (where sov and bin_type are
set) so any unmatched sov values immediately surface; include sov (and any
contextual identifier available) in the exception message to aid debugging and
detect upstream format changes early.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: da388ada-43c0-4b5b-84f1-ade972dceb12
📒 Files selected for processing (1)
uk_bin_collection/uk_bin_collection/councils/NorthNorthamptonshireCouncil.py
|
Merged into the combined March 2026 release PR #1898. Closing to reduce release noise. Thank you for the contribution! |
Extends the North Northamptonshire calendar parser so food waste / caddy collections are classified as
Food caddyinstead of falling through toUnknown.NorthNorthamptonshireCouncil: after Garden, match event titles (lowercased) containingfoodorcaddy, and setbin_typetoFood caddy, before the existingrefuse→ General branch.Summary by CodeRabbit