Skip to content

Fix solr-updater and book page errors when invalid identifier#12547

Merged
mekarpeles merged 1 commit into
internetarchive:masterfrom
cdrini:fix/identifier-null
May 3, 2026
Merged

Fix solr-updater and book page errors when invalid identifier#12547
mekarpeles merged 1 commit into
internetarchive:masterfrom
cdrini:fix/identifier-null

Conversation

@cdrini

@cdrini cdrini commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Part of #12546 . Handles making solr-updater and the book page resilient to None identifiers.

Technical

Testing

Now renders correctly on testing: https://testing.openlibrary.org/works/OL45259313W/Yely%27s_Holiday_Traditions

Screenshot

Stakeholders

Copilot AI review requested due to automatic review settings May 1, 2026 19:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens Solr edition document building (and upstream identifier rendering) against None identifier values, preventing solr-updater crashes like those described in #12546.

Changes:

  • Filter out None identifier values when building edition Solr identifier fields.
  • Skip None identifier values when processing identifiers in the upstream models layer (prevents page/render-time errors).
  • Add a focused unit test validating identifier key normalization and None filtering behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
openlibrary/solr/updater/edition.py Filters None values out of edition identifier lists before calling .strip() and emitting Solr fields.
openlibrary/plugins/upstream/models.py Skips None identifier values during _process_identifiers() to avoid downstream string operations failing.
openlibrary/tests/solr/updater/test_edition.py Adds coverage for EditionSolrBuilder.identifiers with weird keys and None values.

Comment thread openlibrary/solr/updater/edition.py
@cdrini cdrini changed the title Fix solr-updater errors when invalid identifier Fix solr-updater and book page errors when invalid identifier May 1, 2026
@mekarpeles mekarpeles merged commit 1d769d6 into internetarchive:master May 3, 2026
7 checks passed
@cdrini cdrini deleted the fix/identifier-null branch May 4, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants