Skip to content

Commit

Permalink
fix(AbstractSite._check_sanity): ignore future date error when date f…
Browse files Browse the repository at this point in the history
…iled is approximate

Fixes #1321
  • Loading branch information
grossir committed Feb 24, 2025
1 parent 5841163 commit d33c72a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Releases are also tagged in git, if that's helpful.
## Coming up

- Add workflow to check for new entries in CHANGES.md file
- Fixes:
- ignore future date sanity check when date filed is approximate #1321

## Current

Expand Down
7 changes: 6 additions & 1 deletion juriscraper/AbstractSite.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,12 @@ def _check_sanity(self):
self.case_dates[index] = fixed_date

# dates should not be in the future. Tolerate a week
if case_date > (date.today() + timedelta(days=7)):
# If a date is approximate, then it may be set in the future until
# half of the year has passed. Ignore this case
date_is_approximate = self.date_filed_is_approximate[index]
if not date_is_approximate and case_date > (
date.today() + timedelta(days=7)
):
future_date_count += 1
error = f"{self.court_id}: {case_date} date is in the future. Case '{case_name}'"
logger.error(error)
Expand Down

0 comments on commit d33c72a

Please sign in to comment.