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

[ENH] Add GET endpoints for documents #547

Merged
merged 51 commits into from
Feb 5, 2025

Conversation

smokestacklightnin
Copy link
Contributor

@smokestacklightnin smokestacklightnin commented Jan 28, 2025

This PR partially addresses #466 and supersedes certain respective parts of #486.

The new endpoints, all using the GET method, in this PR are as follow:

  • /documents
  • /documents/{id}
  • /documents/{id}/content

Additionally, we now include MIME types in ragna.core.Documents.

A test utility upload_documents is also introduced for convenience when writing tests for endpoints.

Much of the code in this PR is copied from or inspired by @blakerosenthal's #486

@smokestacklightnin smokestacklightnin linked an issue Jan 28, 2025 that may be closed by this pull request
ragna/core/_document.py Outdated Show resolved Hide resolved
ragna/deploy/_engine.py Outdated Show resolved Hide resolved
ragna/deploy/_engine.py Outdated Show resolved Hide resolved
ragna/deploy/_database.py Outdated Show resolved Hide resolved
@smokestacklightnin smokestacklightnin self-assigned this Jan 28, 2025
@smokestacklightnin
Copy link
Contributor Author

I suggest you add a small helper function in this module that performs the upload for you (POST and PUT).

Done

@smokestacklightnin smokestacklightnin force-pushed the ui/enh/document-viewer branch 3 times, most recently from ec92164 to 435a268 Compare February 2, 2025 10:45
@smokestacklightnin
Copy link
Contributor Author

smokestacklightnin commented Feb 3, 2025

The tests for user-specified MIME types in test_endpoints.py are currently failing. Fixing those tests failures is the last item for this PR.

Copy link
Member

@pmeier pmeier left a comment

Choose a reason for hiding this comment

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

Looking pretty good William. Mostly comments about improving the tests. But we are already 95% there! Thanks for your patience!

tests/deploy/api/test_endpoints.py Outdated Show resolved Hide resolved
tests/deploy/api/test_endpoints.py Outdated Show resolved Hide resolved
tests/deploy/api/test_endpoints.py Outdated Show resolved Hide resolved
tests/deploy/api/test_endpoints.py Show resolved Hide resolved
tests/deploy/api/test_endpoints.py Show resolved Hide resolved
tests/deploy/api/test_endpoints.py Show resolved Hide resolved
tests/deploy/api/utils.py Show resolved Hide resolved
@pmeier pmeier merged commit e941366 into Quansight:main Feb 5, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants