[Files] Transform string into part for metadata in upload_files request#207
Open
AMoldova-NI wants to merge 4 commits into
Open
[Files] Transform string into part for metadata in upload_files request#207AMoldova-NI wants to merge 4 commits into
AMoldova-NI wants to merge 4 commits into
Conversation
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Fixes FileClient.upload_file() multipart encoding so the optional metadata argument is sent as a non-file form part (preventing the File service from rejecting it as a file), addressing the 400 Bad Request described in issue #206.
Changes:
- Encode
metadataas a multipart part tuple(None, json, "application/json")instead of passing a raw JSON string to the multipartPart. - Rename the intermediate variable from
metadata_strtometadata_partto reflect the new payload shape.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rbell517
requested changes
May 11, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
rbell517
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this Pull Request accomplish?
Fix
upload_filesmethod to accept metadata field with custom data.Why should this Pull Request be merged?
This fixes a bug issued here #206
What testing has been done?
Testing done using the script provided in the issue