RyukR1 commented on code in PR #3457:
URL: https://github.com/apache/iceberg-python/pull/3457#discussion_r3389348150


##########
pyiceberg/table/inspect.py:
##########
@@ -266,6 +334,29 @@ def partitions(
         row_filter: str | BooleanExpression = ALWAYS_TRUE,
         case_sensitive: bool = True,
     ) -> pa.Table:
+        """Return partition-level statistics for a snapshot as a PyArrow Table.
+
+        Each row represents a unique partition and aggregates statistics
+        across all data and delete files in that partition. For unpartitioned
+        tables, a single row covers the whole table.
+
+        Args:
+            snapshot_id: The snapshot to inspect. Defaults to the current 
snapshot.
+            row_filter: A filter to limit which partitions are included.
+                Accepts a SQL-style string or a ``BooleanExpression``.
+            case_sensitive: Whether column name matching is case-sensitive.
+
+        Returns:
+            pa.Table: A table with columns: ``partition`` (struct, for
+                partitioned tables), ``spec_id``, ``record_count``,

Review Comment:
   Yes, that's correct! spec_id is also only returned for partitioned tables, 
as both partition and spec_id are conditionally added to the schema when 
has_partitions is True. I'll update the docstring to reflect this.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to