Fix author_dates_match comparing only year, ignoring month/day#13066
Open
soumojit-D48 wants to merge 1 commit into
Open
Fix author_dates_match comparing only year, ignoring month/day#13066soumojit-D48 wants to merge 1 commit into
soumojit-D48 wants to merge 1 commit into
Conversation
Collaborator
|
Thanks for this contribution, @soumojit-D48! Welcome to Open Library — this appears to be your first contribution. 🤖 Copilot has been assigned for an initial review. The linked issue (#13065) hasn't been triaged yet — triage happens on Mondays and Fridays. There are currently 29 open non-draft PRs ahead of yours. PR triage checklist (maintainers / Richy)
Note This comment was automatically generated by PAM, Open Library's Project AI Manager. PAM provides status visibility, performs basic project management functions, and gives actionable feedback so contributors aren't left waiting. |
Author
|
@mekarpeles pls review this pr!!! |
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.
Closes #13065
fix
Fixes author_dates_match() returning True for authors with different full dates that happen to share the same year. The function was only comparing 4-digit years, ignoring month/day. A bare year like "1650" still matches any full date in that year — the fix only rejects a match when both records have fully specified dates with genuinely different content.
Technical
After extracting years from both date strings and finding they match, the fix adds a check: if both original strings contain more than just the year (e.g. "01 December 1650" not "1650"), and the full strings differ, return False. This preserves the imprecise-date fallback while catching real mismatches.
Testing