Skip to content

Fix author date precision matching - #13128

Merged
jimchamp merged 1 commit into
internetarchive:masterfrom
MakenRosa:fix/author-date-precision
Jul 10, 2026
Merged

Fix author date precision matching#13128
jimchamp merged 1 commit into
internetarchive:masterfrom
MakenRosa:fix/author-date-precision

Conversation

@MakenRosa

Copy link
Copy Markdown
Contributor

Closes #13065

Fixes author date matching so two fully specified dates with different month/day values no longer match just because they share the same year. Year-only and partial-date comparisons still fall back to the existing year-based behavior for import tolerance.

Technical

  • Adds normalization for common full date formats used by catalog/import data: YYYY-MM-DD, M/D/YYYY, day month year, and month day year.
  • Compares normalized full-date tuples before falling back to year-only matching.
  • Updates the existing FIXME test to assert the correct non-match behavior and preserves a mixed-format import case.

Testing

  • docker compose run --rm --no-deps -e PYTHONPATH=/openlibrary/vendor/infogami home python -m ruff check openlibrary/catalog/utils/__init__.py openlibrary/tests/catalog/test_utils.py
  • docker compose run --rm --no-deps -e PYTHONPATH=/openlibrary/vendor/infogami home python -m pytest openlibrary/tests/catalog/test_utils.py openlibrary/catalog/utils/tests/test_catalog_utils.py openlibrary/catalog/add_book/tests/test_load_book.py::TestImportAuthor::test_birth_and_death_date_match_is_on_year_strings -q
  • docker compose run --rm --no-deps -e PYTHONPATH=/openlibrary/vendor/infogami home python -m pytest openlibrary/catalog/add_book/tests/test_load_book.py -q

Screenshot

N/A

Stakeholders

@jimchamp

@MakenRosa
MakenRosa force-pushed the fix/author-date-precision branch from 7c92943 to bb5b5ce Compare July 7, 2026 01:38
@openlibrary-bot

Copy link
Copy Markdown
Collaborator

Thanks for this contribution, @MakenRosa! Welcome to Open Library β€” this appears to be your first contribution.

@jimchamp is assigned to this PR and currently has:

  • 5 open PR(s) of equal or higher priority to review first
PR triage checklist (maintainers / Richy)
  • PR description β€” not empty; explains what the change does and how to verify it
  • References an issue β€” PR body contains a #NNN reference
    • Linked issue is triaged β€” has a Priority: * label (not just Needs: Triage)
    • Linked issue is assigned β€” has at least one assignee
  • Commit history clean β€” no WIP/fixup/conflict noise; commit messages are meaningful
  • CI passing β€” no failing check-runs
  • Test cases present β€” if the change touches substantive logic, test coverage exists or is explained
  • Proof of testing β€” PR body includes a description of what was tested, a screenshot, or a video

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.

@github-actions github-actions Bot added the Needs: Response Issues which require feedback from lead label Jul 7, 2026
@jimchamp
jimchamp merged commit 7811248 into internetarchive:master Jul 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Response Issues which require feedback from lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Author dates with different month/day but same year are incorrectly considered a match

3 participants