Repository navigation
Stop caching a Settings instance per RELATIVE_BASE value - #1442
Merged
AdrianAtZyte merged 6 commits intoOct 27, 2026
Merged
Conversation
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1442 +/- ##
==========================================
- Coverage 99.18% 99.18% -0.01%
==========================================
Files 239 239
Lines 4052 4026 -26
==========================================
- Hits 4019 3993 -26
Misses 33 33 β View full report in Codecov by Harness. π New features to boost your workflow:
|
AdrianAtZyte
marked this pull request as ready for review
September 24, 2026 13:14
serhii73
approved these changes
Oct 20, 2026
serhii73
left a comment
Collaborator
There was a problem hiding this comment.
Code review (claude code-review, at 0d7c03a). No correctness bug found. The affected suites pass (1137 tests), and applying the PR onto current master and running the full tests directory gives no failures. Settings that differ only in RELATIVE_BASE now share one key, so the dictionary caches stop growing per call, and parse and search timings are unchanged against the PR's merge-base.
Non-blocking notes:
dateparser.utils.registryis removed along with its test. Third-party code importing it will fail withImportError, so a deprecation shim or a changelog note would keep this non-breaking.- The key hashes every setting except
RELATIVE_BASEand_mod_settings, so another per-call setting can still grow the caches, and the same language words are rebuilt per distinctTIMEZONE. An allowlist of the settingsDictionaryactually reads would fix that. registry_keyandget_keykeep their registry names;cache_keywould be clearer. An all-excluded settings object gets the md5 of the empty string rather than"default".- The regression test only checks
_split_regex_cache; four other caches use the same key. The test that identical settings give equalSettingswas deleted and nothing replaces it, and everyreplace()(including one per date insearch_dates) now builds a freshSettings.
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.
Resolves #985