test: add geometry fixture corpus and baselines - #10516
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
All reported issues were addressed across 13 files
Architecture diagram
sequenceDiagram
participant Test as Test Suite
participant Fixtures as geometry_fixtures.py
participant GDF as GeoPandas Data
participant Arrow as PyArrow Tables
participant DuckDB as DuckDB Spatial
participant Ibis as Ibis Table
participant Mgr as Table Manager
participant Snapshot as Snapshot System
Note over Test,Snapshot: Geometry Characterization Flow (CI-skipped except false positives/ordinary)
Test->>Fixtures: Request GDF fixture
alt GeoPandas fixtures
Fixtures->>GDF: Build GeoDataFrame
GDF-->>Fixtures: GeoDataFrame
Fixtures-->>Test: Return frame
Test->>Mgr: get_table_manager(frame)
Mgr->>Mgr: Detect geometry col
Mgr-->>Test: field_types + serialization
else GeoArrow fixtures
Fixtures->>Arrow: Build Table with metadata
Arrow-->>Fixtures: PyArrow Table
Fixtures-->>Test: Return table
Test->>Mgr: get_table_manager(table)
Mgr->>Arrow: Read extension metadata
Arrow-->>Mgr: WKB/WKT/other
Mgr-->>Test: field_types + serialization
else DuckDB fixtures
Test->>Fixtures: duckdb_spatial_connection()
alt Spatial extension loads
Fixtures->>DuckDB: INSTALL+LOAD spatial
DuckDB-->>Fixtures: Connection
Fixtures->>DuckDB: Create relation
DuckDB-->>Fixtures: Relation
Fixtures-->>Test: Return relation
Test->>Mgr: get_table_manager(relation)
Mgr->>DuckDB: Query schema
DuckDB-->>Mgr: geom field type
Mgr-->>Test: unknown type
else Extension fails
Fixtures-->>Test: pytest.skip
end
else Ibis fixture
Test->>Fixtures: ibis_geometry_table()
Fixtures->>Ibis: Connect with spatial
alt Extension available
Ibis-->>Fixtures: Table
Fixtures-->>Test: Return table
Test->>Mgr: get_table_manager(table)
Mgr->>Ibis: Read schema
Ibis-->>Mgr: geospatial:geometry
Mgr-->>Test: unknown type
else Fails
Fixtures-->>Test: pytest.skip
end
end
Note over Test,Snapshot: Baseline Snapshot Flow (runs in CI)
Test->>Fixtures: false_positive_data()
Fixtures-->>Test: Dict with raw_binary, wkt_looking, h3_int
Test->>Mgr: get_table_manager(pandas/polars/pyarrow)
Mgr-->>Test: field_types + JSON
Test->>Snapshot: Compare snapshots
Snapshot-->>Test: Pass/Fail
Test->>Fixtures: ordinary_data()
Fixtures-->>Test: Dict with typed columns
Test->>Mgr: get_table_manager(pyarrow/duckdb)
Mgr-->>Test: field_types + JSON
Test->>Snapshot: Compare snapshots
Snapshot-->>Test: Pass/Fail
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
Pull request overview
Adds a shared geometry fixture corpus and introduces snapshot-based baseline tests to freeze current table-manager serialization/field-type behavior across multiple dataframe backends, in support of upcoming geospatial foundation work.
Changes:
- Add
geometry_fixtures.pywith factory helpers spanning GeoPandas, GeoArrow (WKB/WKT), DuckDB spatial, ibis, plus “false positive” and “ordinary” datasets. - Add characterization and baseline snapshot tests for field-type inference and JSON serialization.
- Add snapshot files capturing current “ordinary” and “false positives” outputs for several backends.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/_plugins/ui/_impl/tables/test_geometry_fixtures.py | Adds characterization tests plus snapshot baselines for “false positives” and “ordinary” payloads. |
| tests/_plugins/ui/_impl/tables/geometry_fixtures.py | Introduces shared fixture factories covering multiple geospatial/tabular backends and baseline datasets. |
| tests/_plugins/ui/_impl/tables/snapshots/ordinary.pyarrow.json | Captures “ordinary” PyArrow JSON payload baseline. |
| tests/_plugins/ui/_impl/tables/snapshots/ordinary.pyarrow.field_types.json | Captures “ordinary” PyArrow field-type baseline. |
| tests/_plugins/ui/_impl/tables/snapshots/ordinary.duckdb.json | Captures “ordinary” DuckDB relation JSON payload baseline. |
| tests/_plugins/ui/_impl/tables/snapshots/ordinary.duckdb.field_types.json | Captures “ordinary” DuckDB field-type baseline. |
| tests/_plugins/ui/_impl/tables/snapshots/false_positives.shapely_objects.field_types.json | Captures baseline field types for shapely objects in a non-geometry column. |
| tests/_plugins/ui/_impl/tables/snapshots/false_positives.pyarrow.json | Captures PyArrow “false positives” JSON payload baseline. |
| tests/_plugins/ui/_impl/tables/snapshots/false_positives.pyarrow.field_types.json | Captures PyArrow “false positives” field-type baseline. |
| tests/_plugins/ui/_impl/tables/snapshots/false_positives.polars.json | Captures Polars “false positives” JSON payload baseline. |
| tests/_plugins/ui/_impl/tables/snapshots/false_positives.polars.field_types.json | Captures Polars “false positives” field-type baseline. |
| tests/_plugins/ui/_impl/tables/snapshots/false_positives.pandas.json | Captures Pandas “false positives” JSON payload baseline. |
| tests/_plugins/ui/_impl/tables/snapshots/false_positives.pandas.field_types.json | Captures Pandas “false positives” field-type baseline. |
Suppressed comments (1)
tests/_plugins/ui/_impl/tables/geometry_fixtures.py:226
- Inline code in docstrings should use single backticks (Markdown), not double backticks.
``INSTALL spatial`` downloads the extension, so network-blocked
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
8732a3c to
e45cc64
Compare
e45cc64 to
45ab961
Compare
45ab961 to
1208204
Compare
1208204 to
a75bcd6
Compare
The geometry corpus uses semantic JSON snapshot comparison, so its documentation must not promise byte-level equality. Keep repeated local runs isolated by closing the DuckDB spatial connection even when an assertion fails, and use the project's Markdown docstring syntax.
a75bcd6 to
6479899
Compare
📝 Summary
Add shared geometry fixtures and current-behavior baselines for the geospatial foundation work in MO-6362. Freeze false-positive and ordinary-table payloads, and keep geometry characterization local until it runs reliably in CI.
🗺️ Stack
This PR is part of a four-PR stack that adds a semantic
geometrytype for geospatial columns (MO-6362). Merge bottom-up with squash. Each PR targets the branch below it, so each diff shows only its own commits. After each merge, I rebase the remaining PRs.geometrycontract and GeoPandas detectionibis detection is deferred: no user demand, and nothing downstream depends on it.
Closes MO-7322