feat(python): expose get_me, get_client, get_clients - #4020
Open
yummyPancake2607 wants to merge 7 commits into
Open
feat(python): expose get_me, get_client, get_clients#4020yummyPancake2607 wants to merge 7 commits into
yummyPancake2607 wants to merge 7 commits into
Conversation
Add system client methods to the Python SDK for parity with Rust SDK: - Add client_info.rs wrapping ClientInfo, ClientInfoDetails, ConsumerGroupInfo types with pyclass getters - Add get_me() -> ClientInfoDetails for current client info - Add get_client(client_id) -> ClientInfoDetails | None - Add get_clients() -> list[ClientInfo] for all connected clients - Register new types in lib.rs pymodule - Add iggy_common dependency for ClientInfo/ConsumerGroupInfo - Add integration tests for all three methods
|
Thanks for the PR. It is labeled Slash commands (own line, regular comment) move it around the queue:
See CONTRIBUTING.md for details. |
Contributor
|
@yummyPancake2607 the ci is failing. could you please check? |
Contributor
|
why didn't you run precommit hooks? please read CONTRIBUTING.md |
- Regenerate apache_iggy.pyi with ClientInfo, ClientInfoDetails, ConsumerGroupInfo classes and get_me/get_client/get_clients methods - Fix ruff lint/format issues in test_client_info.py
Author
|
@hubcio, my bad. I will run it all. Sorry for the earlier work. I will fix it. |
Author
|
i have updated the PR accordingly please check. @slbotbm |
Contributor
|
@yummyPancake2607 the CI is still failing |
…info.py pyrefly flags details.client_id when details may be None. Add assert details is not None before attribute access.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add system client methods to the Python SDK for parity with Rust SDK:
Which issue does this PR address?
Relates to #4015
Rationale
The Rust SDK exposes
get_me,get_client, andget_clientsviaSystemClient, but the Python SDK had none of them. Every other SDK (Java, .NET, Go, etc.) already exposes connection state — this closes the parity gap.What changed?
The Python SDK had no way to inspect the currently connected client or enumerate all connected clients, while every other SDK could. This adds three methods (
get_me,get_client,get_clients) and their associated wrapper types (ClientInfo,ClientInfoDetails,ConsumerGroupInfo) to the Python SDK, following the same pattern used for user types inuser.rs.Local Execution
cargo check,cargo clippy --all-features --all-targets -- -D warnings,cargo fmt --all -- --checkAI Usage
None