This is an automated email from the ASF dual-hosted git repository.

xushiyan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hudi-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new c5ffd67  refactor: rename variable names in splitting table APIs (#424)
c5ffd67 is described below

commit c5ffd670859767dad847b0d9c70e6b15a8813b36
Author: Yunchi Pang <[email protected]>
AuthorDate: Mon Aug 25 18:33:29 2025 -0700

    refactor: rename variable names in splitting table APIs (#424)
---
 crates/core/src/util/collection.rs |  4 ++--
 python/hudi/_internal.pyi          | 13 ++++++++-----
 python/src/internal.rs             | 12 ++++++------
 3 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/crates/core/src/util/collection.rs 
b/crates/core/src/util/collection.rs
index c11de7c..0ebce23 100644
--- a/crates/core/src/util/collection.rs
+++ b/crates/core/src/util/collection.rs
@@ -39,8 +39,8 @@ pub fn split_into_chunks<T: Clone>(items: Vec<T>, num_splits: 
usize) -> Vec<Vec<
         return Vec::new();
     }
 
-    let n = std::cmp::max(1, num_splits);
-    let chunk_size = items.len().div_ceil(n);
+    let num_splits = std::cmp::max(1, num_splits);
+    let chunk_size = items.len().div_ceil(num_splits);
 
     items
         .chunks(chunk_size)
diff --git a/python/hudi/_internal.pyi b/python/hudi/_internal.pyi
index dfe01d6..9642e4e 100644
--- a/python/hudi/_internal.pyi
+++ b/python/hudi/_internal.pyi
@@ -223,13 +223,13 @@ class HudiTable:
         """
         ...
     def get_file_slices_splits(
-        self, n: int, filters: Optional[List[Tuple[str, str, str]]]
+        self, num_splits: int, filters: Optional[List[Tuple[str, str, str]]]
     ) -> List[List[HudiFileSlice]]:
         """
-        Retrieves all file slices in the Hudi table in 'n' splits, optionally 
filtered by given filters.
+        Retrieves all file slices in the Hudi table in 'num_splits' splits, 
optionally filtered by given filters.
 
         Parameters:
-            n (int): The number of parts to split the file slices into.
+            num_splits (int): The number of parts to split the file slices 
into.
             filters (Optional[List[Tuple[str, str, str]]]): Optional filters 
for selecting file slices.
 
         Returns:
@@ -237,10 +237,13 @@ class HudiTable:
         """
         ...
     def get_file_slices_splits_as_of(
-        self, n: int, timestamp: str, filters: Optional[List[Tuple[str, str, 
str]]]
+        self,
+        num_splits: int,
+        timestamp: str,
+        filters: Optional[List[Tuple[str, str, str]]],
     ) -> List[List[HudiFileSlice]]:
         """
-        Retrieves all file slices in the Hudi table as of a timestamp in 'n' 
splits, optionally filtered by given filters.
+        Retrieves all file slices in the Hudi table as of a timestamp in 
'num_splits' splits, optionally filtered by given filters.
         """
         ...
     def get_file_slices(
diff --git a/python/src/internal.rs b/python/src/internal.rs
index 0986a2a..45f545b 100644
--- a/python/src/internal.rs
+++ b/python/src/internal.rs
@@ -330,10 +330,10 @@ impl HudiTable {
         })
     }
 
-    #[pyo3(signature = (n, filters=None))]
+    #[pyo3(signature = (num_splits, filters=None))]
     fn get_file_slices_splits(
         &self,
-        n: usize,
+        num_splits: usize,
         filters: Option<Vec<(String, String, String)>>,
         py: Python,
     ) -> PyResult<Vec<Vec<HudiFileSlice>>> {
@@ -341,7 +341,7 @@ impl HudiTable {
             let file_slices = rt()
                 .block_on(
                     self.inner
-                        .get_file_slices_splits(n, 
filters.unwrap_or_default()),
+                        .get_file_slices_splits(num_splits, 
filters.unwrap_or_default()),
                 )
                 .map_err(PythonError::from)?;
             Ok(file_slices
@@ -351,10 +351,10 @@ impl HudiTable {
         })
     }
 
-    #[pyo3(signature = (n, timestamp, filters=None))]
+    #[pyo3(signature = (num_splits, timestamp, filters=None))]
     fn get_file_slices_splits_as_of(
         &self,
-        n: usize,
+        num_splits: usize,
         timestamp: &str,
         filters: Option<Vec<(String, String, String)>>,
         py: Python,
@@ -362,7 +362,7 @@ impl HudiTable {
         py.allow_threads(|| {
             let file_slices = rt()
                 .block_on(self.inner.get_file_slices_splits_as_of(
-                    n,
+                    num_splits,
                     timestamp,
                     filters.unwrap_or_default(),
                 ))

Reply via email to