feat(python): expose get_me, get_client, get_clients - #4020
feat(python): expose get_me, get_client, get_clients#4020yummyPancake2607 wants to merge 20 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. |
|
@yummyPancake2607 the ci is failing. could you please check? |
|
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
|
@hubcio, my bad. I will run it all. Sorry for the earlier work. I will fix it. |
|
i have updated the PR accordingly please check. @slbotbm |
|
@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.
Reorder classes to alphabetical order as produced by stub_gen: - Move ClientInfo and ClientInfoDetails after AutoLogin - Move ConsumerGroupMember after ConsumerGroupInfo - Remove @typing.final from ConsumerGroupMember - Fix docstring line wrapping
|
It looks like apache_iggy.pyi is out of date. Run 'cargo run --bin stub_gen' from foreign/python, let Ruff format it, and then commit the result. |
|
The three methods and the wrapper types look right and the tests are well shaped. One regression in the stub, plus two small points.
|
Run cargo run --bin stub_gen from foreign/python, let Ruff format it - Add @typing.final to ConsumerGroupMember (generator output) - Reformat docstrings and reorder classes to alphabetical order - No other changes needed - rest matches generator output
|
@justinmclean please approve these so the tests can begin. |
|
@yummyPancake2607 done |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4020 +/- ##
============================================
- Coverage 85.24% 85.24% -0.01%
Complexity 1402 1402
============================================
Files 1236 1237 +1
Lines 182594 182694 +100
Branches 148900 148900
============================================
+ Hits 155661 155740 +79
- Misses 22889 22910 +21
Partials 4044 4044
🚀 New features to boost your workflow:
|
|
@slbotbm it is being able to pass in all the test just againit require approval to finish the tests |
|
/author |
|
you resolved all 17 threads without changing any code. also, stop rebasing PR if it rebases without conflicts. maintainers will take care about it. |
closes: #4015
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