Skip to content

feat(python): return details from topic and consumer group creation - #5104

Open
cryptus-neoxys wants to merge 1 commit into
apache:masterfrom
cryptus-neoxys:feat/cryptus-neoxys/python-create-details
Open

cryptus-neoxys wants to merge 1 commit into
apache:masterfrom
cryptus-neoxys:feat/cryptus-neoxys/python-create-details

Conversation

@cryptus-neoxys

Copy link
Copy Markdown
Contributor

Which issue does this PR address?

Closes #4166

Rationale

The Rust SDK resolves create_topic and create_consumer_group to the created details, while the Python binding discarded the server's reply and resolved to None, forcing a follow-up get_* to learn the server-assigned id. create_stream already returns StreamDetails on current master, so this change closes the remaining scope of #4166.

What changed?

IggyClient.create_topic now resolves to TopicDetails and create_consumer_group to ConsumerGroupDetails, built through the same From conversions that get_topic and get_consumer_group already use, and the regenerated stub carries the new return types and docstrings. The stream, topic and consumer-group create tests assert the returned type, the server-assigned fields, and that a matching fetch agrees on the id. The docs in docs/sdk/python/intro.mdx and foreign/python/README.md state the contract for all four create methods, including that live counters such as a topic partition's segments_count are zero in the create reply and still need a get_*.

Local Execution

  • Passed
  • Pre-commit hooks ran

The focused create tests for stream, topic and consumer group pass against a locally started iggy-server with default root credentials. The full Python suite passes apart from test_resource_options (needs a server configured with an encryption key) and test_tls (needs Docker), which fail locally for missing infrastructure. ruff check, ruff format --check, pyrefly check, cargo clippy --all-targets --all-features -- -D warnings, cargo test, cargo fmt --check, markdownlint and prek on the changed files all pass. The Java and C# pre-push hooks match no changed file and did not run locally because those toolchains are not installed; CI runs them.

Docs

  • Updated docs/

docs/sdk/python/intro.mdx and foreign/python/README.md document the create results.

AI Usage

  1. OpenCode agents in T3 Code (GLM-5.3, DeepSeek V4.1 Flash) wrote the binding changes, the test assertions, the regenerated stub and the docs, and ran the verification commands.
  2. Scope: the entire implementation. The author chose the issue, proposed the approach on it, and approved the branch state before each push.
  3. Verification: the local commands listed above, plus a four-role agent review (storage, perf, distsys, ecosystem) whose two findings this commit addresses.
  4. The author reviewed the final diff before push.

create_topic and create_consumer_group discarded the details the server returned and resolved to None, while create_stream and create_user already returned theirs. Both methods now return TopicDetails and ConsumerGroupDetails, and the create tests assert the returned type and a matching fetch for stream, topic and consumer group.
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Nov 27, 2026
@github-actions

Copy link
Copy Markdown

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

If AI assistance was used to create this PR, you are required to run the team-review skill before opening it.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer
  • /pin - exempt the PR from the stale bot, /unpin to undo

See CONTRIBUTING.md for details.

@cryptus-neoxys

Copy link
Copy Markdown
Contributor Author

team-review ran on this branch before the PR opened, with the four standard roles (storage, perf, distsys, ecosystem) at the then-head 9c0e72e4.

  • storage and ecosystem: the create-topic reply reports segments_count: 0 per partition while get_topic floors a committed partition at 1, so the docs claim that no follow-up get_* is needed was too strong. Fixed by rewording the note in docs/sdk/python/intro.mdx and foreign/python/README.md: live counters are zero in the create reply and still need a get_*.
  • storage and ecosystem: the note omitted create_user, which also resolves to UserInfoDetails. Fixed by listing all four create methods.
  • perf and distsys: no findings.

The review artifacts stay local per the skill. The fixes are in this PR's head 0dcb2244.

@cryptus-neoxys

Copy link
Copy Markdown
Contributor Author

sidenote: discovered a bug while working on the same, created issue #5105
happy to take that up as well, does it need to be in a separate PR, or can the issue be linked to this one itslef

@hubcio @justinmclean

@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.26%. Comparing base (b179e96) to head (0dcb224).

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #5104   +/-   ##
=========================================
  Coverage     92.26%   92.26%           
  Complexity     4367     4367           
=========================================
  Files          1592     1592           
  Lines        436807   436807           
  Branches     365039   365039           
=========================================
+ Hits         403019   403020    +1     
+ Misses        28172    28171    -1     
  Partials       5616     5616           
Components Coverage Δ
Rust Core 93.56% <ø> (ø)
Java SDK 81.03% <ø> (ø)
C# SDK 86.40% <ø> (ø)
Python SDK 85.41% <100.00%> (+0.01%) ⬆️
PHP SDK 90.42% <ø> (ø)
Node SDK 97.26% <ø> (ø)
Go SDK 73.68% <ø> (ø)
C++ SDK 85.44% <ø> (ø)
Files with missing lines Coverage Δ
foreign/python/src/client.rs 97.89% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@justinmclean

Copy link
Copy Markdown
Member

@cryptus-neoxys a separate PR for #5105, please.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python SDK: return details from stream, topic, and consumer group creation

2 participants