Skip to content

fix: preserve version in get/head metadata - #807

Merged
kylebarron merged 1 commit into
mainfrom
kyle/preserve-meta-version
Oct 27, 2026
Merged

kylebarron merged 1 commit into
mainfrom
kyle/preserve-meta-version

Conversation

@kylebarron

Copy link
Copy Markdown
Member

Note

This PR was written by Claude (Claude Code), not by @kylebarron.

Closes #806.

MaybePrefixedStore::strip_meta rebuilt ObjectMeta with version: None. Since #745 started passing get_opts results through it, get and head (and their async variants) on S3Store, GCSStore and AzureStore return version=None even when the store reports one, with or without a prefix.

On GCS, PutMode::Update requires version (the object generation), so a conditional update built from head fails with "Version required for conditional update". S3 and Azure conditional updates only use e_tag, so they kept working.

This keeps meta.version in both strip_meta functions, the same fix upstream made in apache/arrow-rs-object-store#691. #745 ported apache/arrow-rs-object-store#686 but not that follow-up.

The regression shipped in obstore 0.12.0 and pyo3-object_store 0.13.0.

Tests

  • The MinIO session fixture now also creates a bucket with versioning enabled, exposed through a new minio_versioned_store fixture. It's listed in thread_unsafe_fixtures because the tests write and then read the same key.
  • test_head_version and test_get_version check that head and get return the version that put created. Both fail on main with assert None == '<version id>' and pass with this change.

🤖 Written by Claude Code

`MaybePrefixedStore::strip_meta` rebuilt `ObjectMeta` with
`version: None`. Since #745 routed `get_opts` results through it, `get`
and `head` on S3, GCS and Azure stores have returned `version=None` even
when the store reports one, with or without a prefix. On GCS this breaks
conditional updates, which need the object generation in `version`.

Keep `meta.version`, matching upstream's fix in
apache/arrow-rs-object-store#691, and add MinIO regression tests against
a versioned bucket.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ds-release-bot ds-release-bot Bot added the fix label Oct 27, 2026

@kylebarron kylebarron left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

location: self.strip_prefix(meta.location),
e_tag: meta.e_tag,
version: None,
version: meta.version,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kylebarron
kylebarron enabled auto-merge (squash) October 27, 2026 22:01
@kylebarron
kylebarron merged commit 7ac36cf into main Oct 27, 2026
10 checks passed
@kylebarron
kylebarron deleted the kyle/preserve-meta-version branch October 27, 2026 22:01
@kylebarron kylebarron mentioned this pull request Oct 27, 2026
@hpenedones

Copy link
Copy Markdown

thanks for the quick fix @kylebarron !

kylebarron added a commit that referenced this pull request Oct 27, 2026
Patch release for the `get`/`head` `version` regression in 0.12.0
(#806), fixed in #807.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get/head return version=None since 0.12.0 (strip_meta discards ObjectMeta.version)

2 participants