ethanlin01x commented on code in PR #4017:
URL: https://github.com/apache/iggy/pull/4017#discussion_r3910191841
##########
foreign/python/src/client.rs:
##########
@@ -777,6 +777,72 @@ impl IggyClient {
})
}
+ /// Create partitions for a topic.
+ ///
+ /// Args:
+ /// stream_id: Stream identifier as `str | int`.
+ /// topic_id: Topic identifier as `str | int`.
+ /// partitions_count: Number of partitions to create.
+ ///
+ /// Returns:
+ /// An awaitable that resolves to `None` when the partitions are
created.
+ ///
+ /// Raises:
+ /// RuntimeError: If an identifier is invalid or the request fails.
+
#[gen_stub(override_return_type(type_repr="collections.abc.Awaitable[None]",
imports=("collections.abc")))]
+ fn create_partitions<'a>(
+ &self,
+ py: Python<'a>,
+ stream_id: PyIdentifier,
+ topic_id: PyIdentifier,
+ partitions_count: u32,
+ ) -> PyResult<Bound<'a, PyAny>> {
+ let stream_id = Identifier::try_from(stream_id)?;
+ let topic_id = Identifier::try_from(topic_id)?;
+ let inner = self.inner.clone();
+
+ future_into_py(py, async move {
+ inner
+ .create_partitions(&stream_id, &topic_id, partitions_count)
+ .await
+ .map_err(|e| PyErr::new::<pyo3::exceptions::PyRuntimeError,
_>(e.to_string()))?;
+ Ok(())
+ })
+ }
+
+ /// Delete partitions from a topic.
Review Comment:
Please document that this deletes the last `partitions_count` partitions and
drops their messages.
##########
foreign/python/src/client.rs:
##########
@@ -777,6 +777,72 @@ impl IggyClient {
})
}
+ /// Create partitions for a topic.
+ ///
+ /// Args:
+ /// stream_id: Stream identifier as `str | int`.
+ /// topic_id: Topic identifier as `str | int`.
+ /// partitions_count: Number of partitions to create.
Review Comment:
Add as `int`. Same fix for `delete_partitions`
--
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]