Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling AttributeError on structured citation prompt failure #445

Merged
merged 2 commits into from
Sep 21, 2024

Conversation

jamesbraza
Copy link
Collaborator

Our ParsingSettings.structured_citation_prompt extracts a JSON that is supposed to contain the paper's title, DOI, and authors. However, last night I hit a new crash possibility:

  1. The paper Casein Kinase 1δ Triggers Giant Ankyrin Expression had its references on the first page.
  2. This led to ParsingSettings.structured_citation_prompt extracting a list of authors dicts (one dict per reference).
  3. list[dict] was not accounted for in Docs.aadd, it leads to an AttributeError and crashes the indexing process.

This PR handles the AttributeError possibility, and logs a warning if it happens

@jamesbraza jamesbraza added the bug Something isn't working label Sep 20, 2024
@jamesbraza jamesbraza self-assigned this Sep 20, 2024
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Sep 20, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 20, 2024
Copy link
Collaborator

@mskarlin mskarlin left a comment

Choose a reason for hiding this comment

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

thanks for addressing the comment

@jamesbraza jamesbraza force-pushed the attribute-error-citation-prompt branch from ba7300b to b5c3f4e Compare September 20, 2024 21:45
@jamesbraza jamesbraza merged commit 040e69a into main Sep 21, 2024
5 checks passed
@jamesbraza jamesbraza deleted the attribute-error-citation-prompt branch September 21, 2024 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants