Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing parse behaviour for 8 digit date #639

Conversation

arnavkapoor
Copy link
Contributor

@arnavkapoor arnavkapoor commented Mar 19, 2020

Fixes #618
An attempt at #618 , the objective is to improve the parsing of dates of the form XXXXXXXX (Any 8 digit number).

Updated parsing results after this fix

  • 20202001 datetime.datetime(2020, 1, 20, 0, 0)
  • 01201702 datetime.datetime(1702, 1, 20, 0, 0)
  • 01202020 datetime.datetime(2020, 1, 20, 0, 0)
  • 20202020 datetime.datetime(2002, 2, 2, 0, 2)

For the last case 20202020 it's going back to the default behavior.

@codecov
Copy link

codecov bot commented Mar 19, 2020

Codecov Report

Merging #639 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #639      +/-   ##
==========================================
+ Coverage   95.21%   95.23%   +0.02%     
==========================================
  Files         302      302              
  Lines        2506     2521      +15     
==========================================
+ Hits         2386     2401      +15     
  Misses        120      120
Impacted Files Coverage Δ
dateparser/parser.py 98.92% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48c4563...f0bdc74. Read the comment docs.

Copy link
Member

@Gallaecio Gallaecio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me as long as it does not break any existing tests (it does not 👍). Good job!

dateparser/parser.py Outdated Show resolved Hide resolved
dateparser/parser.py Outdated Show resolved Hide resolved
dateparser/parser.py Outdated Show resolved Hide resolved
dateparser/parser.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@noviluni noviluni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome @arnavkapoor !! Thanks you!! 🚀

@noviluni noviluni merged commit 4aaa1c9 into scrapinghub:master Apr 29, 2020
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.

Improve the default parsing of 20110101
3 participants