Skip to content

test: add geometry fixture corpus and baselines - #10516

Merged
kirangadhave merged 2 commits into
mainfrom
kg/geometry-fixture-corpus
Aug 20, 2026
Merged

test: add geometry fixture corpus and baselines#10516
kirangadhave merged 2 commits into
mainfrom
kg/geometry-fixture-corpus

Conversation

@kirangadhave

@kirangadhave kirangadhave commented Aug 12, 2026

Copy link
Copy Markdown
Member

📝 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 geometry type 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.

  1. test: add geometry fixture corpus and baselines #10516: geometry fixture corpus and ordinary-table baselines ⬅️ this PR
  2. feat: add GeoPandas geometry table support #10536: geometry contract and GeoPandas detection
  3. feat: detect GeoArrow columns in PyArrow tables #10558: PyArrow adapter (GeoArrow field metadata)
  4. feat: detect duckdb spatial columns as geometry #10592: DuckDB adapter and SQL metadata (completes the release gate)

ibis detection is deferred: no user demand, and nothing downstream depends on it.

Closes MO-7322

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview Aug 20, 2026 6:06pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@kirangadhave kirangadhave added the internal A refactor or improvement that is not user facing label Aug 12, 2026
@kirangadhave
kirangadhave marked this pull request as ready for review August 12, 2026 03:03
Copilot AI lite review requested due to automatic review settings August 12, 2026 03:03

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread tests/_plugins/ui/_impl/tables/test_geometry_fixtures.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py with 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.

Comment thread tests/_plugins/ui/_impl/tables/test_geometry_fixtures.py
Comment thread tests/_plugins/ui/_impl/tables/test_geometry_fixtures.py
Comment thread tests/_plugins/ui/_impl/tables/test_geometry_fixtures.py Outdated
Comment thread tests/_plugins/ui/_impl/tables/geometry_fixtures.py Outdated
Comment thread tests/_plugins/ui/_impl/tables/geometry_fixtures.py Outdated
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.
@kirangadhave
kirangadhave force-pushed the kg/geometry-fixture-corpus branch from a75bcd6 to 6479899 Compare August 20, 2026 18:05
@kirangadhave
kirangadhave merged commit eece28b into main Aug 20, 2026
41 checks passed
@kirangadhave
kirangadhave deleted the kg/geometry-fixture-corpus branch August 20, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants