LuciferYang commented on code in PR #1323:
URL: https://github.com/apache/paimon-rust/pull/1323#discussion_r4479059868


##########
bindings/python/python/pypaimon_rust/datafusion.pyi:
##########
@@ -567,6 +568,25 @@ class GlobalIndexDropBuilder:
         """Drop matched indexes, or report their count for dry runs."""
         ...
 
+class CompactBuilder:
+    def with_partition_filter(self, predicate: Dict[str, Any]) -> 
"CompactBuilder":
+        """Restrict compaction to matching partitions; repeated calls combine 
with AND."""
+        ...
+    def with_commit_user(self, commit_user: str) -> "CompactBuilder":
+        """Set the commit identity; snapshots record 
``<commit_user>-compact-<suffix>``."""
+        ...
+    def execute(self) -> Dict[str, int]:
+        """Plan, execute and commit all tasks; return the task count and write 
metrics.
+
+        No commit is made when planning yields no task. A failed task's error 
is
+        raised after a best-effort deletion of earlier tasks' files; a failed
+        deletion is reported as a ``RuntimeWarning``.
+
+        Warning: This method blocks on a DataFusion runtime.
+        Calling this from an active asyncio event loop will result in a panic.

Review Comment:
   Replaced the panic note. The docstring now says `execute()` blocks the 
calling thread with the GIL released, so a caller on an asyncio loop should use 
`await asyncio.to_thread(builder.execute)`.



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