Skip to content

Implement a PARSERS setting - #603

Merged
noviluni merged 5 commits into
scrapinghub:masterfrom
Gallaecio:allow-disabling-relative-times
Mar 6, 2020
Merged

noviluni merged 5 commits into
scrapinghub:masterfrom
Gallaecio:allow-disabling-relative-times

Conversation

@Gallaecio

Copy link
Copy Markdown
Contributor

Fixes #312, fixes #525

@codecov

codecov Bot commented Dec 17, 2019 •

Copy link
Copy Markdown

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

noviluni commented Jan 17, 2020 •

Copy link
Copy Markdown
Contributor

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)

@noviluni noviluni left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@Gallaecio

@Gallaecio

Copy link
Copy Markdown
Contributor Author

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

@noviluni noviluni left a comment

Copy link
Copy Markdown
Contributor

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).

Comment thread dateparser/date.py Resolved
Comment thread docs/usage.rst Resolved
Comment thread tests/test_search.py Resolved

@noviluni noviluni left a comment

Copy link
Copy Markdown
Contributor

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
@noviluni noviluni mentioned this pull request Sep 11, 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