FenjuFu commented on code in PR #4357:
URL: https://github.com/apache/iggy/pull/4357#discussion_r4216338787
##########
foreign/python/src/client.rs:
##########
@@ -1098,6 +1098,52 @@ impl IggyClient {
})
}
+ /// Delete the oldest sealed segments of a partition, including all
messages
+ /// stored in them. The active segment is never deleted, and deletion
stops at
+ /// the lowest offset any consumer or consumer group has committed on the
+ /// partition, so fewer than `segments_count` segments may be removed.
+ ///
+ /// Args:
+ /// stream_id: Stream identifier as `str | int`.
+ /// topic_id: Topic identifier as `str | int`.
+ /// partition_id: Partition ID as `int`.
+ /// segments_count: Maximum number of segments to delete as `int`,
starting
+ /// from the oldest; `0` deletes nothing.
+ ///
+ /// Returns:
+ /// An awaitable that resolves to `None` when deletion is accepted;
segment
+ /// files are removed asynchronously.
+ ///
+ /// Raises:
+ /// ValueError: If an identifier is invalid.
Review Comment:
Checked this on CI: an out-of-range int identifier raises `TypeError`, not
`OverflowError`. `PyIdentifier` is a derived `str | u32` enum, and when neither
variant matches, pyo3 reports it as a `TypeError`. I documented that in the
docstring and stub and added a test for `stream_id` and `topic_id`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]