forked from 0xWheatyz/SPARC
Fix analyze_single_patent to download PDF before reading from disk #694
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Roadmap item: P2 Backend - analyze_single_patent missing download step
analyze_single_patentconstructs the pathpatents/{patent_id}.pdfand reads from disk, but does not download the PDF first. Callers must pre-download the file or the method silently fails.Work to do
analyze_single_patent: check if the file exists; if not, download it (reusing the existing download logic used elsewhere in the codebase)Acceptance criteria
analyze_single_patentfor a patent whose PDF has not been downloaded either fetches it automatically or raises a clearFileNotFoundErrorwith a helpful messageClosing as already implemented. analyze_single_patent now downloads the PDF before reading from disk. Fixed in PR #55 (feature/fix-single-patent-download).