Fix search_dates language fallback#1331
Open
Kill1ngPig wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1331 +/- ##
==========================================
+ Coverage 97.10% 97.12% +0.01%
==========================================
Files 235 235
Lines 2904 2917 +13
==========================================
+ Hits 2820 2833 +13
Misses 84 84 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
Please, run |
Author
|
Thanks for the reminder. I ran |
AdrianAtZyte
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix
search_dates()so it can fall back to other explicitly provided languages when the initially selected language does not find any dates.Fixes #1326.
Problem
When
search_dates()is called with multiple languages andSTRICT_PARSING=True, the language selection step may choose a language that cannot parse the date expression. In that case, the current implementation stops after the first selected language and returns no dates, even if another explicitly provided language can parse the same text.For example, this French date is parsed correctly with
languages=["fr"], but was previously dropped when several languages were provided:"Date de facture 23 juillet 2020 Condition Redevable livraison FR"Changes
STRICT_PARSING=Truecase from search_dates() silently drops a French date when STRICT_PARSING=True and multiple languages are passed #1326.This is not specific to French or to the
FRsuffix. It handles the broader case where the first selected language fails but another user-provided language can parse the date.Tests
Result: