scrapinghub / scrapinghub/dateparser

Unsafe usage parsing dates with ambiguous order

Open
#539 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Enhancement
Dominant language
Python
Stars
2.9k
Forks
520
Avg merge
22h 56m
Merged PRs (30d)
6

Description

Suppose you have a list of dates you're parsing like:

15/4/2019
16/4/2019
24/4/2019
2/5/2019

dateparser will parse the first 3 as d/m/y and the last as m/d/y. I think it's possible to fix the data after this has been discovered since the flipping only occurs when the day is > 12, but it's not easy to notice in the first place.

Would it be possible to create an interface which would raise an error if it detects this occurring? Or perhaps warn about this boldly in the readme? (Or both?)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the README and the date-order parsing behavior described in the issue. Clarify whether the project wants a runtime error, a warning, README guidance, or a combination; the work is done only once the chosen behavior and its handling of ambiguous dates are defined and documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation, localization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.