Fix PDF-from-dump pipeline and fallbacks - #2
Merged
Conversation
Restore a working fallback_bioc_pmc after a bad merge (syntax error that blocked importing paperscraper.pdf), re-add NCBIRateLimitError, fix missing as_completed/tqdm imports for medRxiv S3, load SPRINGER_API_KEY, and wire ChemRxiv Open Engage helpers into save_pdf. Also validate key_to_save and align the Elsevier mock test with header-based auth. Co-authored-by: Davide Gotta <MoonDavid@users.noreply.github.com>
- Guard bioRxiv/medRxiv S3 when AWS keys are missing - Recognize 10.1101 DOIs for preprint S3 fallbacks - Validate PDF bytes before opening files (fixes empty leftovers under mocks) - Skip S3 sections in tests without AWS credentials - Update paywalled-chapter expectation now that arXiv fallback can succeed Co-authored-by: Davide Gotta <MoonDavid@users.noreply.github.com>
MoonDavid
marked this pull request as ready for review
August 5, 2026 13:26
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.
Summary
Repairs the broken PDF download path so
save_pdf/save_pdf_from_dumpwork again, and closes related gaps in the existing fallback stack.Fixes
fallback_bioc_pmc: restore after a bad merge that left aSyntaxError(blocked importingpaperscraper.pdfentirely). Re-addsNCBIRateLimitError, PMCID assignment, retries, andncbi_emailsupport.medrxiv_s3: add missingas_completed/tqdmimports.load_api_keys: loadSPRINGER_API_KEY.save_pdf(HTML scraping is Cloudflare-blocked).save_pdf_from_dump: validatekey_to_save(doi/title/date), create output dir, skip papers missing the filename key.X-ELS-APIKeyauth.Verification