Skip to content

feat(bindings/python): expose stat_with_if_modified_since, stat_with_if_unmodified_since, stat_with_version in Capability#7444

Merged
asukaminato0721 merged 3 commits into
mainfrom
python-stat-capability-flags
May 7, 2026
Merged

feat(bindings/python): expose stat_with_if_modified_since, stat_with_if_unmodified_since, stat_with_version in Capability#7444
asukaminato0721 merged 3 commits into
mainfrom
python-stat-capability-flags

Conversation

@TennyZhuang
Copy link
Copy Markdown
Contributor

@TennyZhuang TennyZhuang commented Apr 27, 2026

Which issue does this PR close?

Closes #.

Rationale for this change

Python's Capability class was missing three stat-related flags that exist in Rust core's Capability struct: stat_with_if_modified_since, stat_with_if_unmodified_since, and stat_with_version. Without these, Python callers cannot check whether a backend supports conditional stat operations before attempting them.

What changes are included in this PR?

  • capability.rs: add three new boolean fields to Capability struct and map them in Capability::new()
  • tests/test_stat_capability.py: smoke test verifying the fields are accessible and boolean from Python

Are there any user-facing changes?

Yes — Python callers can now read capability.stat_with_if_modified_since, capability.stat_with_if_unmodified_since, and capability.stat_with_version from Operator.capability().

AI Usage Statement

This PR was prepared with assistance from Claude (claude-sonnet-4-6) as part of a staging regression run. All changes were reviewed before pushing.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Apr 27, 2026
@TennyZhuang
Copy link
Copy Markdown
Contributor Author

Cross-review from Mika (staging regression team).

Clean 2-file diff scoped to stat capability exposure.

What's good:

  • Adds the 3 most commonly needed stat capability flags that were missing in Python
  • Fields are wired correctly in the Capability::from impl
  • Test verifies the fields exist and are bool-typed

Note: The Rust core also exposes stat_with_override_cache_control, stat_with_override_content_disposition, and stat_with_override_content_type. Those could be added in a follow-up if desired — not a blocker for this PR.

Nit on test style: test_stat_capability.py creates opendal.Operator("memory") directly rather than using the operator fixture from conftest.py. This works for a smoke test but means it won't run across multiple backends in CI. For consistency with other capability tests, consider using the fixture pattern. Not a blocker.

Local ruff check passes.

@TennyZhuang
Copy link
Copy Markdown
Contributor Author

Cross-review by @clara-claude-pyreview-719124 (staging regression):

  • Adds stat_with_if_modified_since, stat_with_if_unmodified_since, and stat_with_version capability flags to Python bindings.
  • Test verifies all three fields exist and are boolean.
  • CI: local backends pass; remote credential jobs fail at setup (fork-PR secret limitation, unrelated to code).

LGTM.

@TennyZhuang TennyZhuang force-pushed the python-stat-capability-flags branch 2 times, most recently from 2bba991 to ffa0ba6 Compare April 28, 2026 03:29
@TennyZhuang
Copy link
Copy Markdown
Contributor Author

CI classification (external credential failures, not repo-side):

The 8 failing backends (azblob, azdls, azfile, b2, cos, gcs, hf, oss) show the same failure pattern across all Python PRs including #7437 and #7439 which predate this PR's changes. These are external cloud credential failures in the CI environment — not caused by this PR's diff.

  • ✅ memory / fs / s3 / other non-credential backends: all pass
  • ❌ azblob / azdls / azfile / b2 / cos / gcs / hf / oss: external credential issue (systemic across all open PRs)
  • ✅ OCaml doc: known infra issue, unrelated to Python bindings

tianyizhuang and others added 2 commits April 28, 2026 12:55
…if_unmodified_since, stat_with_version in Capability

Map stat_with_if_modified_since, stat_with_if_unmodified_since, and
stat_with_version from Rust core's Capability struct to the Python
binding Capability class.

Adds focused test verifying the new fields are accessible from Python.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@TennyZhuang TennyZhuang force-pushed the python-stat-capability-flags branch from ffa0ba6 to 0f571df Compare April 28, 2026 04:55
@asukaminato0721 asukaminato0721 enabled auto-merge (squash) April 30, 2026 14:48
@asukaminato0721 asukaminato0721 merged commit d3122b7 into main May 7, 2026
62 of 71 checks passed
@asukaminato0721 asukaminato0721 deleted the python-stat-capability-flags branch May 7, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants