feat: Add more bins to Edinburgh City Council#2133
Conversation
|
Warning Review limit reached
More reviews will be available in 12 minutes and 11 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRefactors ChangesEdinburgh Council Bin Collection Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@uk_bin_collection/uk_bin_collection/councils/EdinburghCityCouncil.py`:
- Around line 198-203: In the _get_food_bin function, add explicit validation
after calling _get_collection_day to check if the returned food_collection_day
is None. If it is None, raise an exception with a clear error message indicating
that the collection day field could not be found on the record page, rather than
allowing the subsequent days_of_week.index() call to fail with a confusing
ValueError. This ensures debugging is easier when the field is missing from the
webpage.
- Around line 110-127: The _get_garden_calendar_code function has two issues:
First, the condition on line 125 uses `if target_idx > 0` but str.find() returns
-1 when the substring is not found (not some value less than 0), so the check
should be `if target_idx >= 0` or `if target_idx != -1` to correctly handle
cases where "garden-waste-calendar-" appears at position 0. Second, the
docstring incorrectly states the function "extract the collection day" when it
actually extracts the garden calendar code; update the docstring to accurately
describe what the function does.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ff8fae33-6345-418e-94e0-732acd804e56
📒 Files selected for processing (1)
uk_bin_collection/uk_bin_collection/councils/EdinburghCityCouncil.py
Summary
Summary by CodeRabbit
Release Notes
New Features
Refactor