Conversation
ctali
reviewed
Sep 17, 2026
| return file_multihash | ||
| except FileNotFoundError as error: | ||
| raise NoSuchFileError(source) from error | ||
| except client("s3").exceptions.ClientError as ce: |
Contributor
There was a problem hiding this comment.
could the exception be handled without creating another S3 client here?
Contributor
Author
There was a problem hiding this comment.
fixed (also in pre-existing places)
ctali
reviewed
Sep 17, 2026
| ClientError | ||
| """ | ||
| start_time = time_in_ms() | ||
| os.makedirs(os.path.dirname(destination), mode=0o777, exist_ok=True) |
Contributor
There was a problem hiding this comment.
Or is destination always expected to have a directory? Otherwise, could os.path.dirname(destination) return an empty string and cause os.makedirs() to fail?
amfage
reviewed
Sep 17, 2026
| ClientError | ||
| """ | ||
| start_time = time_in_ms() | ||
| with fs_local.atomic_write_path(destination) as partial_destination: |
Collaborator
There was a problem hiding this comment.
Will this leave an empty file behind if _get_object_body() fails?
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.
Motivation
16-bit COGs may exceed 5GB, which
PutObjectrejects withEntityTooLarge.Modifications
fs.copy()streams instead of buffering, usingupload_filefors3so multipart uploads are handled automatically. It now returns the multihash rather than the target path. Call sites doingwrite(target, read(source))moved to it.STAC reuses the multihash instead of reading the asset back to checksum it.
Verification
Unit tests for the streaming helpers, all four
copy()directions, and the checksum passthrough;file:checksumvalues pinned against precomputed hashes.IN PROGRESS: Mackenzie RGBNIR workflow test run to confirm the >5GB upload end to end.