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

fix translate keep_formatting #720

Merged
merged 1 commit into from Oct 31, 2022

Conversation

noviluni
Copy link
Collaborator

When parsing a string it is "translated". When doing it, the commas are missed, and because of that some date formats in the base-formats parser doesn't work.

Before this change:

>>> dateparser.parse('December 04, 1999, 11:04:59 PM', settings={'PARSERS': ['base-formats']})

It should work because '%B %d, %Y, %I:%M:%S %p' is the first date format when trying with `base-formats, but it doesn't.

After this change:

>>> dateparser.parse('December 04, 1999, 11:04:59 PM', settings={'PARSERS': ['base-formats']})
datetime.datetime(1999, 12, 4, 23, 4, 59)

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.

Nice!

@codecov
Copy link

codecov bot commented Jun 24, 2020

Codecov Report

Base: 95.23% // Head: 96.89% // Increases project coverage by +1.66% 🎉

Coverage data is based on head (4596ad3) compared to base (6dc38bb).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #720      +/-   ##
==========================================
+ Coverage   95.23%   96.89%   +1.66%     
==========================================
  Files         302      307       +5     
  Lines        2560     3774    +1214     
==========================================
+ Hits         2438     3657    +1219     
+ Misses        122      117       -5     
Impacted Files Coverage Δ
dateparser/languages/locale.py 98.72% <100.00%> (+0.06%) ⬆️
dateparser/date_parser.py 100.00% <0.00%> (ø)
dateparser/data/__init__.py 100.00% <0.00%> (ø)
dateparser/utils/strptime.py 100.00% <0.00%> (ø)
dateparser/calendars/hijri.py 100.00% <0.00%> (ø)
dateparser/search/__init__.py 100.00% <0.00%> (ø)
dateparser/calendars/jalali.py 100.00% <0.00%> (ø)
dateparser/languages/loader.py 100.00% <0.00%> (ø)
dateparser/languages/__init__.py 100.00% <0.00%> (ø)
dateparser/data/languages_info.py 100.00% <0.00%> (ø)
... and 224 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@noviluni
Copy link
Collaborator Author

@Gallaecio maybe we don't need this 🤔

please, take a look to this: #721

@noviluni
Copy link
Collaborator Author

Even if we decided to remove the base-formats parser (#721), I will keep this PR open to check if this is affecting the custom-formats parser. From my first attempts, it seems that the custom-formats doesn't take into account commas, etc. so we could consider that it's working wrongly. I will investigate this further.

@serhii73 serhii73 closed this Oct 31, 2022
@serhii73 serhii73 reopened this Oct 31, 2022
@serhii73 serhii73 merged commit 8023f91 into scrapinghub:master Oct 31, 2022
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.

None yet

3 participants