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

Implement a PARSERS setting #603

Merged

Conversation

Gallaecio
Copy link
Member

Fixes #312, fixes #525

@codecov
Copy link

codecov bot commented Dec 17, 2019

Codecov Report

Merging #603 into master will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #603      +/-   ##
==========================================
+ Coverage   95.12%   95.21%   +0.08%     
==========================================
  Files         302      302              
  Lines        2504     2506       +2     
==========================================
+ Hits         2382     2386       +4     
+ Misses        122      120       -2
Impacted Files Coverage Δ
dateparser/timezones.py 100% <ø> (ø) ⬆️
dateparser/parser.py 98.89% <ø> (+0.54%) ⬆️
dateparser/data/date_translation_data/en.py 100% <ø> (ø) ⬆️
dateparser/data/date_translation_data/nb.py 100% <ø> (ø) ⬆️
dateparser/utils/strptime.py 100% <ø> (ø) ⬆️
dateparser/freshness_date_parser.py 98.94% <100%> (ø) ⬆️
dateparser/languages/locale.py 98.65% <100%> (ø) ⬆️
dateparser/date.py 98% <100%> (+0.02%) ⬆️

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 2cdc754...2141e0a. Read the comment docs.

@noviluni
Copy link
Collaborator

noviluni commented Jan 17, 2020

I think it is a really good idea. Moreover, it is necessary to implement this in some way to allow showing what parser has been used when implementing the DEBUG_INFO flag (draft PR: https://github.com/scrapinghub/dateparser/pull/561/files)

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.

Really good job here.

Maybe it's not necessary to add it before merging, but it could be a good idea to mention the existing "parsers" in the docs explaining what each one does.

Related to this are the parsers names. I think we should meditate on the names as then are going to be a “public API”. Adding the explanation to the docs will help us to find out the best name for each parser.

@noviluni
Copy link
Collaborator

@Gallaecio

@Gallaecio
Copy link
Member Author

Added the list of parsers to the documentation with a brief description about each one of them.

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.

I left some comments. Really good job here, it could be amazing to include this in the next release (expecting to be this month).

dateparser/date.py Outdated Show resolved Hide resolved
docs/usage.rst Show resolved Hide resolved
tests/test_search.py 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.

Ok, I like the approach.

I would mention the "settings" in the error, to make easier to find and fix the error, but it's not necessary, it works as expected.

@noviluni noviluni merged commit c7a89b0 into scrapinghub:master Mar 6, 2020
@Gallaecio Gallaecio mentioned this pull request Mar 9, 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.

can be prevent searching relative dates Disabling relative times
3 participants