paleolimbot commented on code in PR #92:
URL: https://github.com/apache/sedona-db/pull/92#discussion_r2353119272


##########
python/sedonadb/python/sedonadb/dataframe.py:
##########
@@ -361,6 +361,55 @@ def show(
         width = _out_width(width)
         print(self._impl.show(self._ctx, limit, width, ascii), end="")
 
+    def explain(
+        self,
+        verbose: bool = False,
+        analyze: bool = False,
+        format: str = "indent",
+        width: Optional[int] = None,
+        ascii: bool = False,
+    ) -> str:
+        """Print the execution plan for this DataFrame
+
+        Shows the logical and physical execution plans that will be used to
+        compute this DataFrame. This is useful for understanding query
+        performance and optimization.
+
+        Args:
+            verbose: Use True to show additional details in the plan output.
+            analyze: Use True to actually execute the plan and report metrics.
+            format: The format to use for displaying the plan. Supported 
formats are
+                "indent", "tree", "pgjson" and "graphviz"
+            width: The number of characters to use to display the output.
+                If None, uses `Options.width` or detects the value from the
+                current terminal if available.
+            ascii: Use True to disable UTF-8 characters in the output.
+
+        Returns:
+            A string representation of the execution plan.
+
+        Examples:
+
+            >>> import sedonadb
+            >>> con = sedonadb.connect()
+            >>> df = con.sql("SELECT 1 as one")
+            >>> print(df.explain())

Review Comment:
   Ah, I was confused since that doesn't happen in notebooks:
   
   
https://github.com/duckdb/duckdb-python/blob/14245ff33f591863296261bf07cabd48a7e803fa/src/duckdb_py/pyrelation.cpp#L1765-L1766
   
   In any case anything is Ok here (it's all a vast improvement over the opaque 
limit error we got before)



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