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

Đang mở
#4,166 2 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@EthemKD đang làm issue này rồi.

Từ ngày 14/9/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

good first issue python
Description

The Rust SDK returns the created resource details from these methods:

async fn create_stream(&self, name: &str)
    -> Result<StreamDetails, IggyError>;

async fn create_topic(
    &self,
    stream_id: &Identifier,
    name: &str,
    options: &TopicCreateOptions,
) -> Result<TopicDetails, IggyError>;

async fn create_consumer_group(
    &self,
    stream_id: &Identifier,
    topic_id: &Identifier,
    name: &str,
) -> Result<ConsumerGroupDetails, IggyError>;

The Python methods perform the creation successfully but discard these return values and resolve to None.

StreamDetails, TopicDetails, and ConsumerGroupDetails are already implemented and registered as Python classes, so no new wrapper types are required.

This covers B13, B17, and B21 of the Python SDK parity work tracked in #3893.

Affected area / component

Python SDK

Proposed solution
  • Change IggyClient.create_stream() to return StreamDetails.
  • Change IggyClient.create_topic() to return TopicDetails.
  • Change IggyClient.create_consumer_group() to return ConsumerGroupDetails.
  • Convert each Rust result through the existing From implementation instead of discarding it.
  • Update the method documentation and regenerate foreign/python/apache_iggy.pyi.
  • Extend the existing stream, topic, and consumer-group tests to assert that:
    • The returned type is the corresponding Details class.
    • The returned ID, name, and resource-specific fields match the created resource.
    • Fetching the resource afterward returns matching details.

This changes only successful return values; existing arguments and error behavior remain unchanged.

Alternatives considered

Keep returning None and require a second get_* request. This adds an unnecessary round trip and remains inconsistent with the Rust API.

Contribution
  • I'm willing to submit a pull request to implement this feature
Good first issue
  • I think this could be a good first issue for a new contributor
Ngôn ngữ chính
Rust
Star
5.2k
Fork
502
Merge trung bình
3 ngày 8 giờ
Pull request đã merge (30 ngày)
146

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/iggy

Tất cả issue của apache/iggy

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.