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


##########
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:
   [P2] Describe the blocking behavior of execute() in asyncio
   
   An active Python asyncio loop does not enter a Tokio runtime. I ran 
`execute()` inside `asyncio.run()` on a table with two compaction tasks and it 
completed both tasks. On that path, the synchronous call blocks the Python 
event-loop thread until it returns. The nested-runtime panic applies when the 
calling thread is already executing Tokio.
   
   Please document the event-loop blocking behavior here so async callers know 
when to offload the call to a worker thread.
   



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