Skip to content

feat: add storage_class, requester_pays, object_tags, and extra_s3_args config options - #173

Open
Jenia3377543 wants to merge 2 commits into
treeverse:mainfrom
Jenia3377543:feature/s3-storage-class-and-extra-args
Open

feat: add storage_class, requester_pays, object_tags, and extra_s3_args config options#173
Jenia3377543 wants to merge 2 commits into
treeverse:mainfrom
Jenia3377543:feature/s3-storage-class-and-extra-args

Conversation

@Jenia3377543

Copy link
Copy Markdown

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 modify config parameters that map into s3_additional_kwargs, which s3fs forwards to every boto3 write call:

Config key boto3 key Notes
storage_class StorageClass e.g. STANDARD, REDUCED_REDUNDANCY, or provider-specific class
requester_pays RequestPayer Boolean; sets value to "requester" for requester-pays buckets
object_tags Tagging URL-encoded key=value pairs, e.g. env=prod&team=ml
extra_s3_args merged into kwargs Generic JSON escape hatch for any other boto3 S3 write param; overrides named params on key collision

None-valued keys are filtered out by the existing flatten/unflatten logic so unset params do not pollute the dict.

Usage

dvc remote modify myremote storage_class REDUCED_REDUNDANCY
dvc remote modify myremote requester_pays true
dvc remote modify myremote object_tags "env=prod&team=ml"
# or for anything not natively supported:
dvc remote modify myremote extra_s3_args '{"StorageClass": "WARM"}'

Tests

11 new unit tests — 20/20 passing. Covers each new param, the not-set case, JSON error handling, and extra_s3_args overriding a named param.

Docs PR: iterative/dvc.org (link to follow)

…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>
@CLAassistant

CLAassistant commented Jul 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

…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
Jenia3377543 force-pushed the feature/s3-storage-class-and-extra-args branch from d28ce82 to c7c4206 Compare July 10, 2026 14:00
@Jenia3377543

Copy link
Copy Markdown
Author

Hi @skshetry !

We're using DVC with an S3-compatible storage provider that requires setting a custom StorageClass (and occasionally other boto3 write
parameters) on uploaded objects. There was no way to do this through DVC config — the values were silently ignored.

This PR adds four new dvc remote modify options that map directly into s3_additional_kwargs (forwarded by s3fs to every boto3 write call):

  • storage_class → StorageClass
  • requester_pays → RequestPayer
  • object_tags → Tagging
  • extra_s3_args → generic JSON dict for anything not covered by the named options

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!

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