Skip to content

Commit 8844b1c

Browse files
committed
Handle v3 geospatial write limitation in integration test
1 parent 115e955 commit 8844b1c

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

tests/integration/test_geospatial_integration.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)