jiengup opened a new issue, #4164:
URL: https://github.com/apache/iggy/issues/4164
### Description
The Rust `update_user()` API accepts `UserUpdateOptions`, but the Python
wrapper always passes `UserUpdateOptions::default()`:
```rust
async fn update_user(
&self,
user_id: &Identifier,
username: Option<&str>,
status: Option<UserStatus>,
options: &UserUpdateOptions,
) -> Result<(), IggyError>;
```
The current server has no updatable user option keys, so every non-empty map
is presently rejected. The raw options field nevertheless exists to allow
future server-side keys without another wire or SDK signature change.
The Python stream and topic update APIs already expose equivalent raw option
maps.
This covers B32 of the Python SDK parity work tracked in #3893.
### Affected area / component
Python SDK
### Proposed solution
- Add an optional keyword argument `options: dict[str, str] | None = None`
to `IggyClient.update_user()`.
- Build `UserUpdateOptions { raw: options.unwrap_or_default() }`, following
the existing `update_stream()` pattern.
- Preserve the current behavior when `options` is omitted or `None`.
- Regenerate `foreign/python/apache_iggy.pyi` and update the method
documentation.
- Extend `foreign/python/tests/test_user.py` to verify:
- Existing username and status updates still work when `options` is
omitted.
- An empty options map succeeds.
- An unknown non-empty option is forwarded and rejected by the current
server.
Introducing typed user options is outside this issue.
### Alternatives considered
Keep the options hardcoded until the server defines its first user option.
That would require another Python API change when such an option is introduced.
### Contribution
- [ ] I'm willing to submit a pull request to implement this feature
### Good first issue
- [x] I think this could be a good first issue for a new contributor
--
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]