@@ -247,7 +247,9 @@ class Snapshot(IcebergBaseModel):
247247 first_row_id : Optional [int ] = Field (
248248 alias = "first-row-id" , default = None , description = "assigned to the first row in the first data file in the first manifest"
249249 )
250- added_rows : Optional [int ] = Field (alias = "added-rows" , default = None , description = "The upper bound of the number of rows with assigned row IDs" )
250+ added_rows : Optional [int ] = Field (
251+ alias = "added-rows" , default = None , description = "The upper bound of the number of rows with assigned row IDs"
252+ )
251253
252254 def __str__ (self ) -> str :
253255 """Return the string representation of the Snapshot class."""
@@ -257,6 +259,22 @@ def __str__(self) -> str:
257259 result_str = f"{ operation } id={ self .snapshot_id } { parent_id } { schema_id } "
258260 return result_str
259261
262+ def __repr__ (self ) -> str :
263+ """Return the string representation of the Snapshot class."""
264+ fields = [
265+ f"snapshot_id={ self .snapshot_id } " ,
266+ f"parent_snapshot_id={ self .parent_snapshot_id } " ,
267+ f"sequence_number={ self .sequence_number } " ,
268+ f"timestamp_ms={ self .timestamp_ms } " ,
269+ f"manifest_list='{ self .manifest_list } '" ,
270+ f"summary={ repr (self .summary )} " if self .summary else None ,
271+ f"schema_id={ self .schema_id } " if self .schema_id is not None else None ,
272+ f"first_row_id={ self .first_row_id } " if self .first_row_id is not None else None ,
273+ f"added_rows={ self .added_rows } " if self .added_rows is not None else None ,
274+ ]
275+ filtered_fields = [field for field in fields if field is not None ]
276+ return f"Snapshot({ ', ' .join (filtered_fields )} )"
277+
260278 def manifests (self , io : FileIO ) -> List [ManifestFile ]:
261279 """Return the manifests for the given snapshot."""
262280 return list (_manifests (io , self .manifest_list ))
0 commit comments