Skip to content

[BUG] duckdb visualization broken in 1.4.0 and onwards #1020

@RaczeQ

Description

@RaczeQ

Context

What results were you expecting?

when calling viz function with duckdb relation it throws AssertionError: One column must have GeoArrow extension metadata error.

Resulting behaviour, error message or logs

Code skips duckdb detection and goes straight to __arrow_c_stream__ check.

It seems like this check stopped working:

if (
        data.__class__.__module__.startswith("duckdb")
        and data.__class__.__name__ == "DuckDBPyRelation"
    ):
        return _viz_duckdb_relation(data, **kwargs)  # type: ignore

    if (
        data.__class__.__module__.startswith("duckdb")
        and data.__class__.__name__ == "DuckDBPyConnection"
    ):
        raise TypeError(DUCKDB_PY_CONN_ERROR)

Because now DuckDB module looks like this: <class '_duckdb.DuckDBPyRelation'>

Environment

  • OS: WSL Ubuntu
  • Browser: N/A
  • Lonboard Version: 0.12.1

Steps to reproduce the bug

import duckdb
from lonboard import viz

relation = duckdb.read_parquet(...)

viz(relation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions