Skip to content

fix: SwaleBoroughCouncil - handle relative date strings#2002

Open
InertiaUK wants to merge 1 commit intorobbrad:masterfrom
InertiaUK:fix/SwaleBoroughCouncil-relative-dates
Open

fix: SwaleBoroughCouncil - handle relative date strings#2002
InertiaUK wants to merge 1 commit intorobbrad:masterfrom
InertiaUK:fix/SwaleBoroughCouncil-relative-dates

Conversation

@InertiaUK
Copy link
Copy Markdown
Contributor

Swale's bin page shows "is due today" or potentially "is due tomorrow" as the collection date text on collection day. The existing parser had an exact-match check (== "is due today") which failed intermittently on case or whitespace variations.

Changes:

  • Normalise the date string (strip + lowercase) before checking
  • Use substring matching ("today" in normalised) instead of exact equality
  • Added "tomorrow" handling for the day-before case

The scraper was failing intermittently when the cron ran on collection day for the test address, then self-recovering the next day. This makes it reliable regardless of when it runs.

The council page shows "is due today" or "is due tomorrow" as the
collection date on the day of (or day before) collection. The parser
used an exact string match for "is due today" which broke on case
variations. Switched to case-insensitive substring matching and
added "tomorrow" handling.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 3, 2026

Warning

Rate limit exceeded

@InertiaUK has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 31 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0e99b282-1b25-447e-bccc-6e171004a8a9

📥 Commits

Reviewing files that changed from the base of the PR and between 8ecf878 and 6ff2260.

📒 Files selected for processing (1)
  • uk_bin_collection/uk_bin_collection/councils/SwaleBoroughCouncil.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 59 minutes and 31 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.67%. Comparing base (8ecf878) to head (6ff2260).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2002   +/-   ##
=======================================
  Coverage   86.67%   86.67%           
=======================================
  Files           9        9           
  Lines        1141     1141           
=======================================
  Hits          989      989           
  Misses        152      152           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant