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

python(feature): file attachments upload + download service #85

Merged
merged 11 commits into from
Aug 23, 2024

Conversation

solidiquis
Copy link
Collaborator

@solidiquis solidiquis commented Aug 16, 2024

Changes

Added sift_py.file_attachment module to leverage the file attachments API. The FileAttachmentService from said module allows for ergonomic uploading, downloading, retrieving attachments for various entities, as well as bulk deleting.

Unit testing + documentation updates included. Examples will be added in a separate PR, though the documentation already includes plenty of examples.

Screenshot 2024-08-16 at 16 38 39

@solidiquis solidiquis marked this pull request as ready for review August 16, 2024 23:42
@zachAtSiftStack
Copy link
Collaborator

nit: docs typo, drop the word "support"
Screenshot 2024-08-19 at 11 15 51 AM

it also support provides utilities....

@zachAtSiftStack
Copy link
Collaborator

The error log for a bad api key or run id (not sure which) wasn't really helpful

(filevenv) (venv) ➜  ingestion_with_python_config git:(python/feature-file-attachment) ✗ python3 test_file_attach.py
Traceback (most recent call last):
  File "/Users/zachplunkett/Code/sift/python/examples/ingestion_with_python_config/test_file_attach.py", line 45, in <module>
    remote_file = file_attachment_service.upload_attachment(
  File "/Users/zachplunkett/venvs/filevenv/lib/python3.9/site-packages/sift_py/file_attachment/service.py", line 80, in upload_attachment
    remote_file_id = self._upload_service.upload_attachment(
  File "/Users/zachplunkett/venvs/filevenv/lib/python3.9/site-packages/sift_py/file_attachment/_internal/upload.py", line 90, in upload_attachment
    raise Exception(response.text)
Exception

But after that it worked as expected :)

Screenshot 2024-08-19 at 6 03 53 PM

Copy link
Collaborator

@zachAtSiftStack zachAtSiftStack left a comment

Choose a reason for hiding this comment

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

LGTM, Approving

python/lib/sift_py/file_attachment/service.py Show resolved Hide resolved
python/lib/sift_py/file_attachment/_internal/upload.py Outdated Show resolved Hide resolved
@solidiquis solidiquis merged commit 4c3cf15 into main Aug 23, 2024
7 checks passed
@solidiquis solidiquis deleted the python/feature-file-attachment branch August 23, 2024 20:52
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.

2 participants