feat: add storage_class, requester_pays, object_tags, and extra_s3_args config options - #173
Open
Jenia3377543 wants to merge 2 commits into
Open
Conversation
…gs config options Expose four new config parameters for S3 remotes that map to boto3 write kwargs via s3_additional_kwargs, enabling use with S3-compatible providers (MinIO, Scaleway, Ceph, etc.) that require non-default settings: - storage_class: sets StorageClass on uploaded objects - requester_pays: sets RequestPayer=requester for requester-pays buckets - object_tags: sets Tagging with URL-encoded key=value pairs - extra_s3_args: generic JSON escape hatch for any additional boto3 S3 write parameters not covered by the above named options; when a key overlaps with a named option, extra_s3_args takes precedence Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gs to fix ruff violations _prepare_credentials was over the complexity/branch/statement limits (C901, PLR0912, PLR0915) after the new params were added. Extract SSE logic into _prepare_sse_kwargs and all s3_additional_kwargs population into _prepare_s3_additional_kwargs, each well within ruff limits. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Jenia3377543
force-pushed
the
feature/s3-storage-class-and-extra-args
branch
from
July 10, 2026 14:00
d28ce82 to
c7c4206
Compare
Author
|
Hi @skshetry ! We're using DVC with an S3-compatible storage provider that requires setting a custom StorageClass (and occasionally other boto3 write This PR adds four new dvc remote modify options that map directly into s3_additional_kwargs (forwarded by s3fs to every boto3 write call):
All existing tests pass and 11 new unit tests are included. A matching docs PR is open at treeverse/dvc.org#5582. Would really appreciate a review and, if everything looks good, a patch release so we can start using this upstream. Happy to adjust anything. Thanks! |
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.
Problem
Users running DVC against S3-compatible providers (MinIO, Scaleway, Ceph, DigitalOcean Spaces, etc.) often need to control per-object S3 parameters — most commonly
StorageClass— that the provider requires or that differs from the AWS default. There was no way to set these through DVC config; values were silently ignored.Solution
Four new
dvc remote modifyconfig parameters that map intos3_additional_kwargs, whichs3fsforwards to every boto3 write call:storage_classStorageClassSTANDARD,REDUCED_REDUNDANCY, or provider-specific classrequester_paysRequestPayer"requester"for requester-pays bucketsobject_tagsTaggingenv=prod&team=mlextra_s3_argsNone-valued keys are filtered out by the existingflatten/unflattenlogic so unset params do not pollute the dict.Usage
Tests
11 new unit tests — 20/20 passing. Covers each new param, the not-set case, JSON error handling, and
extra_s3_argsoverriding a named param.Docs PR: iterative/dvc.org (link to follow)