chitralverma opened a new pull request, #7883:
URL: https://github.com/apache/opendal/pull/7883

   # Which issue does this PR close?
   
   Follow-up to #7824.
   
   # Rationale for this change
   
   #7824 dropped per-service constructor typing when moving to PyO3 
introspection.
   This restores strongly-typed, per-service configuration with 
editor/type-checker
   support.
   
   # What changes are included in this PR?
   
   Adds typed per-service config classes (e.g. `S3Config`) generated into
   `opendal.services`, and `Operator.from_config` / `AsyncOperator.from_config`:
   
   ```python
   from opendal.services import S3Config
   op = opendal.Operator.from_config(S3Config(bucket="my-bucket"))
   ```
   
   Types and docstrings come from PyO3 introspection over the generated 
pyclasses,
   so there is no hand-maintained type mapping. Configs wrap the core config 
struct
   and build via `Operator::from_config`, so nested fields (lists, maps) and all
   core field types are supported. Stubs are generated with `services-all` to 
match
   released wheels.
   
   **Approach — pros:** no hand-maintained Rust→Python type mapping; strong
   Rust↔core contract; nested maps and all field types supported; single 
generation
   template.
   **Cons:** larger generated `services.rs`; tighter coupling to core config
   internals.
   
   **Alternative considered:** frozen Python dataclasses generated as `.py` (no 
Rust
   config pyclasses) — smaller changeset and looser coupling, but needs a
   hand-maintained type mapping and cannot carry map-valued config fields.
   
   # Are there any user-facing changes?
   
   Additive only. New `Operator.from_config` / `AsyncOperator.from_config` and
   `opendal.services.*Config` classes. `Operator(scheme, **kwargs)` and 
`from_uri`
   are unchanged.
   
   # AI Usage Statement
   
   Assisted by an AI coding agent (Claude). All changes were reviewed by the 
author.
   


-- 
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]

Reply via email to