Skip to content

Match date_formats month and weekday names in the given languages - #1486

Merged
AdrianAtZyte merged 1 commit into
scrapinghub:masterfrom
AdrianAtZyte:localized-date-formats
Sep 30, 2026
Merged

AdrianAtZyte merged 1 commit into
scrapinghub:masterfrom
AdrianAtZyte:localized-date-formats

Conversation

@AdrianAtZyte

@AdrianAtZyte AdrianAtZyte commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Fixes #433

@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 97.26%. Comparing base (3ec5fe3) to head (5a114cd).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1486      +/-   ##
==========================================
+ Coverage   97.21%   97.26%   +0.04%     
==========================================
  Files         236      236              
  Lines        3093     3139      +46     
==========================================
+ Hits         3007     3053      +46     
  Misses         86       86              

β˜” 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:localized-date-formats (5a114cd) with master (3ec5fe3)

Open in CodSpeed

@AdrianAtZyte
AdrianAtZyte marked this pull request as ready for review September 29, 2026 21:31

@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 dd49b2d into scrapinghub:master Sep 30, 2026
18 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.

Formats passed in date_formats only work for English, even if languages=["es"]

2 participants