Skip to content

Python SDK: expose delete_segments #4328

Description

@justinmclean

The Rust client has SegmentClient::delete_segments (core/common/src/traits/segment_client.rs), but the Python SDK has no binding for it. It is listed as Easy in the Python API alignment tracking issue, #3893.

What to do

  • Add delete_segments(stream_id, topic_id, partition_id, segments_count) to foreign/python/src/client.rs. delete_partitions in the same file is the model to copy: it takes the same stream, topic and partition arguments, and this adds one u32 count.
  • Regenerate foreign/python/apache_iggy.pyi by running cargo run --bin stub_gen from foreign/python, and commit the result. CI fails if the stub is out of date.
  • Add foreign/python/tests/test_segment.py, following the setup and teardown in test_partition.py.

Done when

await client.delete_segments(stream_id, topic_id, partition_id, segments_count) returns None against a running server, and the new test passes.

Part of #3893.

Activity

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

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomerspythonPull requests that update Python code

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions