Elioooon commented on code in PR #4017:
URL: https://github.com/apache/iggy/pull/4017#discussion_r3922179052


##########
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:
   Addressed in ec33ea7: `test_partition_management_accepts_numeric_ids` now 
exercises both `create_partitions` and `delete_partitions` with integer stream 
and topic IDs.



##########
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:
   Addressed in 8080ce3. The Python docstring now states that deletion removes 
the last `partitions_count` partitions and all messages stored in them, and the 
generated `.pyi` stub is synchronized.



-- 
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]

Reply via email to