syun64 commented on code in PR #603:
URL: https://github.com/apache/iceberg-python/pull/603#discussion_r1564235822


##########
pyiceberg/table/__init__.py:
##########
@@ -3410,6 +3411,94 @@ def _readable_metrics_struct(bound_type: PrimitiveType) 
-> pa.StructType:
             schema=entries_schema,
         )
 
+    def partitions(self) -> "pa.Table":
+        import pyarrow as pa
+
+        from pyiceberg.io.pyarrow import schema_to_pyarrow
+
+        table_schema = pa.schema([
+            pa.field('record_count', pa.int64(), nullable=False),
+            pa.field('file_count', pa.int32(), nullable=False),
+            pa.field('total_data_file_size_in_bytes', pa.int64(), 
nullable=False),
+            pa.field('position_delete_record_count', pa.int64(), 
nullable=False),
+            pa.field('position_delete_file_count', pa.int32(), nullable=False),
+            pa.field('equality_delete_record_count', pa.int64(), 
nullable=False),
+            pa.field('equality_delete_file_count', pa.int32(), nullable=False),
+            pa.field('last_updated_at', pa.timestamp(unit='ms'), 
nullable=True),
+            pa.field('last_updated_snapshot_id', pa.int64(), nullable=True),
+        ])
+
+        partition_record = self.tbl.metadata.specs_struct()
+        has_partitions = len(partition_record.fields) > 0
+
+        if has_partitions:

Review Comment:
   Sounds good @Fokko . That makes sense. Just wanted to double check if we 
wanted to carry this logic over.



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