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

PDF Encrypted Case #2764

Merged
merged 2 commits into from
Oct 10, 2024
Merged

PDF Encrypted Case #2764

merged 2 commits into from
Oct 10, 2024

Conversation

yuhongsun96
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Oct 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 10, 2024 5:15pm

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This pull request enhances the handling of encrypted PDF files in the Danswer project's file processing module.

  • Improved read_pdf_file function in backend/danswer/file_processing/extract_file_text.py to gracefully handle encrypted PDFs without passwords
  • Added logging for encrypted PDFs, allowing them to be discoverable by title without processing content
  • Ensures encrypted PDFs don't cause errors during processing, maintaining system stability
  • Aligns with existing error handling patterns in the file, improving overall code consistency
  • May require updates to integration tests to cover new encrypted PDF handling scenarios

1 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

else:
logger.warning("No Password available to to decrypt pdf")
elif pdf_reader.is_encrypted:
logger.warning("No Password available to to decrypt pdf, returning empty")
Copy link

Choose a reason for hiding this comment

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

syntax: typo in 'to to', should be 'to'

Comment on lines +211 to +213
elif pdf_reader.is_encrypted:
logger.warning("No Password available to to decrypt pdf, returning empty")
return "", metadata
Copy link

Choose a reason for hiding this comment

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

style: consider moving this block before the previous condition to avoid nested if statements

@yuhongsun96 yuhongsun96 merged commit 85d5e6c into main Oct 10, 2024
7 checks passed
@yuhongsun96 yuhongsun96 deleted the log-fix branch October 10, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant