Skip to content

Try other meanings of ambiguous words when a date does not parse - #1491

Merged
AdrianAtZyte merged 3 commits into
scrapinghub:masterfrom
AdrianAtZyte:ambiguous-word-fallback
Sep 30, 2026
Merged

AdrianAtZyte merged 3 commits into
scrapinghub:masterfrom
AdrianAtZyte:ambiguous-word-fallback

Conversation

@AdrianAtZyte

Copy link
Copy Markdown
Member

Part of #676

@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.61111% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.85%. Comparing base (36d0af5) to head (82c82fe).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
dateparser/date.py 97.22% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1491      +/-   ##
==========================================
+ Coverage   92.53%   98.85%   +6.31%     
==========================================
  Files         238      238              
  Lines        3255     3317      +62     
==========================================
+ Hits         3012     3279     +267     
+ Misses        243       38     -205     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 7 untouched benchmarks


Comparing AdrianAtZyte:ambiguous-word-fallback (82c82fe) with master (36d0af5)

Open in CodSpeed

@AdrianAtZyte
AdrianAtZyte marked this pull request as ready for review September 29, 2026 23:05
@AdrianAtZyte
AdrianAtZyte marked this pull request as draft September 29, 2026 23:05
@AdrianAtZyte
AdrianAtZyte marked this pull request as ready for review September 29, 2026 23:27

@serhii73 serhii73 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@AdrianAtZyte
AdrianAtZyte merged commit a495650 into scrapinghub:master Sep 30, 2026
19 checks passed
AdrianAtZyte pushed a commit that referenced this pull request Oct 27, 2026
#1486 tries every combination of the English names that each month or
weekday name of the string can stand for. A name with two meanings, such
as Spanish "mar" (martes or marzo), doubles the number of combinations,
so a string with many such names made parse() with date_formats try an
ever larger number of strptime calls before giving up.

Try only the first _MAX_TRANSLATIONS combinations, the same limit that
#1491 uses for the other readings of words with several meanings.

Tested: a new test checks that 12 "mar" yield exactly _MAX_TRANSLATIONS
distinct readings (it got 4096 before the change); the #1486 tests still
pass; full suite, ruff and mypy pass.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants