Skip to content

Expose remaining Topic and TopicDetails fields in the Python SDK #3577

Description

@mattp5657

Title

Expose remaining Topic and TopicDetails fields in the Python SDK

Description

The Python SDK's Topic and TopicDetails classes expose only a subset of the
fields available on their Rust counterparts (iggy::prelude::Topic /
TopicDetails), so a topic's full configuration can't be read from Python and
those fields can't be asserted in tests.

Already exposed:

  • TopicDetails: id, name, messages_count, partitions_count,
    compression_algorithm, replication_factor
  • Topic: id, name, messages_count, partitions_count

This issue tracks adding getters (with docstrings) for the remaining fields.

TopicDetails:

  • created_at (IggyTimestamp)
  • size (IggyByteSize)
  • message_expiry (IggyExpiry)
  • max_topic_size (MaxTopicSize)
  • partitions (Vec<Partition>)

Topic:

  • created_at (IggyTimestamp)
  • size (IggyByteSize)
  • message_expiry (IggyExpiry)
  • compression_algorithm (CompressionAlgorithm)
  • max_topic_size (MaxTopicSize)
  • replication_factor (u8)

Affected area / component

Python SDK (foreign/python)

Proposed solution

Add #[getter] methods to Topic and TopicDetails in
foreign/python/src/topic.rs, regenerate apache_iggy.pyi via stub_gen, and
add corresponding tests. For the tri-state enum fields, settle on a faithful
Python representation (e.g. small wrapper classes) before implementing.

Alternatives considered

No response

Contribution

I will work on this once 3572 is closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions