chitralverma opened a new pull request, #9415:
URL: https://github.com/apache/opendal/pull/9415
# Which issue does this PR close?
Part of #9321.
# Rationale for this change
Core `ListOptions::glob` has no Python keyword argument. Discussion #5692
(opened by this PR's author) asks to copy a glob selection from `fs` to object
storage in Python, and #1251 requested glob matching in core. No other Python
caller is known. Java (#9234) and .NET (#8440) expose `glob`; tracker #9320
plans the same for Python.
# What changes are included in this PR?
- Add `glob` to the `ListOptions` table in `dev/src/generate/python.rs`. The
generated class, `ListKwargs`, and the conversion to core now set it.
- Add `glob=None` to `Operator.list` and `AsyncOperator.list`. The
deprecated `scan` does not take it.
- Render a `Self::field` code span as the Python keyword argument. A
`Self::` span that names a field Python does not expose fails generation.
- Python drops core's `SimulateLayer` sentence, but the next sentence
depends on it. Replace it with "Services with native glob support handle
patterns directly; otherwise OpenDAL evaluates patterns client-side."
- Add sync and async tests on the behavior-test service: a `**/*.txt` match
and `opendal.exceptions.ConfigInvalid` for an empty pattern.
Verified: every `ListKwargs.glob` doc claim on memory (simulated glob) and
fs (native glob), sync and async (82 checks: `*`, `?`, `**`, `{a,b}`, sets,
escapes, trailing `/`, prefix paths, `start_after`, `ConfigInvalid` from
`list()`, `Unsupported` without the capability); 9 mutations fail the new
tests; `just stub-gen`, `just lint`, `just test-typing`, Sphinx `-W -n`, the
memory (503) and fs (552) suites on macOS and Linux; `dev` tests (184); every
`ci_odev.yml` generator with `git diff --exit-code`.
Not verified: services other than memory and fs; the `list_with_recursive`
requirement, because Python's default `SimulateLayer` always simulates
recursive listing.
# Are there any user-facing changes?
- `Operator.list` and `AsyncOperator.list` take a new keyword-only `glob:
str | None = None`. `ListKwargs` gains a `glob` key. Without `glob`, `list`
behaves as before.
# Breaking changes
None.
# AI Usage Statement
- **Harness:** Claude Code via T3 Code | **Model:** Claude Opus 5.5 |
**Effort:** to confirm
- **Role:** Implemented the generator, binding, and test changes, verified
the doc claims, and drafted this text. The author reviews every change and
claim.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]