File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
tests/integration/test_writes Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,22 @@ def __str__(self) -> str:
257257 result_str = f"{ operation } id={ self .snapshot_id } { parent_id } { schema_id } "
258258 return result_str
259259
260+ def __repr__ (self ) -> str :
261+ """Return the string representation of the Snapshot class."""
262+ fields = [
263+ f"snapshot_id={ self .snapshot_id } " ,
264+ f"parent_snapshot_id={ self .parent_snapshot_id } " ,
265+ f"sequence_number={ self .sequence_number } " ,
266+ f"timestamp_ms={ self .timestamp_ms } " ,
267+ f"manifest_list='{ self .manifest_list } '" ,
268+ f"summary={ repr (self .summary )} " if self .summary else None ,
269+ f"schema_id={ self .schema_id } " if self .schema_id is not None else None ,
270+ f"first_row_id={ self .first_row_id } " if self .first_row_id is not None else None ,
271+ f"added_rows={ self .added_rows } " if self .added_rows is not None else None ,
272+ ]
273+ filtered_fields = [field for field in fields if field is not None ]
274+ return f"Snapshot({ ', ' .join (filtered_fields )} )"
275+
260276 def manifests (self , io : FileIO ) -> List [ManifestFile ]:
261277 """Return the manifests for the given snapshot."""
262278 return list (_manifests (io , self .manifest_list ))
Original file line number Diff line number Diff line change @@ -2493,13 +2493,12 @@ def test_stage_only_overwrite_files(
24932493
24942494
24952495@pytest .mark .integration
2496- def test_v3_write_and_read (spark : SparkSession , session_catalog : Catalog ) -> None :
2496+ def test_v3_write_and_read_row_lineage (spark : SparkSession , session_catalog : Catalog ) -> None :
24972497 """Test writing to a v3 table and reading with Spark."""
24982498 identifier = "default.test_v3_write_and_read"
24992499 tbl = _create_table (session_catalog , identifier , {"format-version" : "3" })
25002500 assert tbl .format_version == 3 , f"Expected v3, got: v{ tbl .format_version } "
2501- assert tbl .metadata .next_row_id is not None , "Expected next_row_id to be initialized"
2502- initial_next_row_id = tbl .metadata .next_row_id
2501+ initial_next_row_id = tbl .metadata .next_row_id or 0
25032502
25042503 test_data = pa .Table .from_pydict (
25052504 {
You can’t perform that action at this time.
0 commit comments