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

feat(toolkit): support multipart for saving bytes #397

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

efiop
Copy link
Contributor

@efiop efiop commented Jan 24, 2025

No description provided.

@efiop efiop requested a review from chamini2 January 24, 2025 19:11
Copy link
Member

@chamini2 chamini2 left a comment

Choose a reason for hiding this comment

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

It looks good as a start, but I don't see where we are making from_bytes use multipart here

@@ -672,7 +788,7 @@ def save_file(
multipart = os.path.getsize(file_path) > threshold

if multipart:
url = self._save_multipart(
url = MultipartUpload.save_file(
Copy link
Member

Choose a reason for hiding this comment

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

since now .save handles this, you could just forward all the multipart-related args to it and leave the decision to save

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean to self.save? It only handles bytes though, but here we need to handle file, so that we don't read it all into memory.

Copy link
Member

@chamini2 chamini2 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the replies

@efiop efiop merged commit 306261d into main Jan 24, 2025
10 checks passed
@efiop efiop deleted the ruslan/from_bytes-multipart branch January 24, 2025 21:14
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