Fokko commented on code in PR #2631:
URL: https://github.com/apache/iceberg-python/pull/2631#discussion_r2446812374


##########
pyiceberg/table/snapshots.py:
##########
@@ -242,9 +242,44 @@ class Snapshot(IcebergBaseModel):
     sequence_number: Optional[int] = Field(alias="sequence-number", 
default=INITIAL_SEQUENCE_NUMBER)
     timestamp_ms: int = Field(alias="timestamp-ms", default_factory=lambda: 
int(time.time() * 1000))
     manifest_list: str = Field(alias="manifest-list", description="Location of 
the snapshot's manifest list file")
+    first_row_id: Optional[int] = Field(
+        alias="first-row-id",
+        default=None,
+        description="The row-id of the first newly added row in this snapshot. 
Returns None when row lineage is not supported.",
+    )
+    added_rows: Optional[int] = Field(
+        alias="added-rows",
+        default=None,
+        description=(
+            "The upper bound of number of rows with assigned row IDs in this 
snapshot. Returns None if the value was not stored."
+        ),
+    )
     summary: Optional[Summary] = Field(default=None)
     schema_id: Optional[int] = Field(alias="schema-id", default=None)
 
+    @field_validator("first_row_id")
+    @classmethod
+    def validate_first_row_id(cls, v: Optional[int]) -> Optional[int]:

Review Comment:
   Pydantic also allows for annotating with `PositiveInt` which will do these 
checks internally: 
https://docs.pydantic.dev/2.3/api/types/#pydantic.types.PositiveInt



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