scrapinghub / scrapinghub/dateparser
Search dates fails depending on whitespaces around prefix ":"
Open
Nobody has claimed this yet.
search_dates
Type: Bug
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 520
- Avg merge
- 22h 56m
- Merged PRs (30d)
- 6
Description
Version:
- dateparser==0.76
How to reproduce:
# parsed date is correct
search_dates("Date 22.06.2020", languages=["de"], settings={'DATE_ORDER': 'DMY'})
> [('22.06.2020', datetime.datetime(2020, 6, 22, 0, 0))]
# parsed date is wrong (prefix " :")
search_dates("Date :22.06.2020", languages=["de"], settings={'DATE_ORDER': 'DMY'})
> [('22.06.2020', datetime.datetime(1900, 1, 1, 2, 2))]
# parsed date is different, but still wrong (prefix ":")
search_dates("Date:22.06.2020", languages=["de"], settings={'DATE_ORDER': 'DMY'})
> [('2020', datetime.datetime(2020, 8, 12, 0, 0))]
# parsed date is correct (prefix ": ")
search_dates("Date: 22.06.2020", languages=["de"], settings={'DATE_ORDER': 'DMY'})
> [('22.06.2020', datetime.datetime(2020, 6, 22, 0, 0))]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the four search_dates examples from the issue against dateparser 0.76, then trace the search_dates parsing path. Add coverage for the whitespace variants around the colon and confirm each returns the expected 22 June 2020 date.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 62/100