Fokko commented on code in PR #2146:
URL: https://github.com/apache/iceberg-python/pull/2146#discussion_r2164807131
##########
pyiceberg/table/statistics.py:
##########
@@ -29,15 +29,24 @@ class BlobMetadata(IcebergBaseModel):
properties: Optional[Dict[str, str]] = None
-class StatisticsFile(IcebergBaseModel):
+class StatisticsCommonFields(IcebergBaseModel):
+ """Common fields between table and partition statistics structs found on
metadata."""
+
snapshot_id: int = Field(alias="snapshot-id")
statistics_path: str = Field(alias="statistics-path")
file_size_in_bytes: int = Field(alias="file-size-in-bytes")
+
+
+class StatisticsFile(StatisticsCommonFields):
Review Comment:
Ah, I see. I don't think it makes sense to subclass both.
The statistics both share the same fields, so I think we can reuse them:
<img width="718" alt="image"
src="https://github.com/user-attachments/assets/e65103c0-6623-4a1d-9a0e-60234d224cc1"
/>
<img width="705" alt="image"
src="https://github.com/user-attachments/assets/9b5497c4-991f-4c9c-85ef-01d5ac951418"
/>
--
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]