@@ -77,19 +77,23 @@ def test_write_read_roundtrip_geospatial(catalog: Catalog) -> None:
7777 table = catalog .create_table (
7878 identifier = identifier ,
7979 schema = schema ,
80- # Keep this aligned with writer capabilities until v3 manifest writing is supported.
81- properties = {TableProperties .FORMAT_VERSION : str (SUPPORTED_TABLE_FORMAT_VERSION )},
80+ properties = {TableProperties .FORMAT_VERSION : "3" },
8281 )
8382
8483 geom = struct .pack ("<BIIdddd" , 1 , 2 , 2 , 1.0 , 2.0 , 3.0 , 4.0 )
8584 geog = struct .pack ("<BIIdddd" , 1 , 2 , 2 , 170.0 , 10.0 , - 170.0 , 20.0 )
86- table .append (
87- pa .Table .from_pydict (
88- {"id" : [1 ], "geom" : [geom ], "geog" : [geog ]},
89- schema = schema_to_pyarrow (schema ),
90- )
85+ data = pa .Table .from_pydict (
86+ {"id" : [1 ], "geom" : [geom ], "geog" : [geog ]},
87+ schema = schema_to_pyarrow (schema ),
9188 )
9289
90+ if SUPPORTED_TABLE_FORMAT_VERSION < 3 :
91+ with pytest .raises ((NotImplementedError , ValueError ), match = r"(V3|v3|version: 3)" ):
92+ table .append (data )
93+ return
94+
95+ table .append (data )
96+
9397 scanned = table .scan ().to_arrow ()
9498 assert scanned ["id" ][0 ].as_py () == 1
9599 assert _as_bytes (scanned ["geom" ][0 ].as_py ()) == geom
0 commit comments