fix: handle S3 URIs with empty storage correctly #6444
Draft
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.
Summary
Problem
When returning S3 objects from Python scripts using the format
{"s3": path}
, the system would auto-detect it as an S3 asset using thes3:///
prefix. However, this caused the parseS3Object function to return an empty string for storage, which led to backend validation errors.Solution
Updated the parseS3Object function to check if the storage value is an empty string and convert it to undefined. This ensures the backend APIs receive the correct parameters and can handle S3 objects without explicit storage/bucket names.
Test Plan
Tested the parseS3Object function with various inputs:
{"s3": "path/to/file.csv"}
→ works correctly{"s3": "path/to/file.csv", "storage": "mybucket"}
→ works correctly"s3:///path/to/file.csv"
→ now correctly returns undefined for storage"s3://mybucket/path/to/file.csv"
→ works correctlyResolves #6442
Important
Fixes
parseS3Object
inutils.ts
to handle S3 URIs with empty storage by converting empty storage strings toundefined
, preventing backend errors.parseS3Object
inutils.ts
to handle S3 URIs with empty storage by converting empty storage strings toundefined
.parseS3Object
with various inputs to ensure correct handling of empty storage in S3 URIs.This description was created by
for 6c218dc. You can customize this summary. It will automatically update as commits are pushed.