Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ibis/backends/duckdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,7 @@ def execute(
col.to_pylist()
if (
pat.is_nested(col.type)
or pat.is_dictionary(col.type)
or
# pyarrow / duckdb type null literals columns as int32?
# but calling `to_pylist()` will render it as None
Expand Down
20 changes: 20 additions & 0 deletions ibis/backends/duckdb/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,3 +483,23 @@
assert list(df.columns) == ["value", "id", "date"]
assert list(schema.names) == ["id", "value", "date"]
con.create_table(name, df, schema=schema, temp=True)


@pytest.mark.parametrize(

Check warning on line 488 in ibis/backends/duckdb/tests/test_client.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/duckdb/tests/test_client.py#L488

Added line #L488 was not covered by tests
"converter",
[
lambda expr: expr.to_pyarrow().to_pylist(),
lambda expr: expr.to_pandas().tolist(),
],
ids=["pyarrow", "pandas"],
)
def test_basic_enum_schema_inference(con, converter):
name = gen_name("basic_enum_schema_inference")
con.con.execute(

Check warning on line 498 in ibis/backends/duckdb/tests/test_client.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/duckdb/tests/test_client.py#L496-L498

Added lines #L496 - L498 were not covered by tests
f"CREATE TEMP TABLE {name} AS "
"SELECT CAST('a' AS ENUM('a', 'b')) e UNION ALL "
"SELECT CAST('b' AS ENUM('a', 'b')) e"
)
t = con.table(name)
assert t.e.type() == dt.string
assert set(converter(t.e)) == {"a", "b"}

Check warning on line 505 in ibis/backends/duckdb/tests/test_client.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/duckdb/tests/test_client.py#L503-L505

Added lines #L503 - L505 were not covered by tests
1 change: 1 addition & 0 deletions ibis/backends/duckdb/tests/test_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
("DATE", dt.date),
("DOUBLE", dt.float64),
("DECIMAL(10, 3)", dt.Decimal(10, 3)),
("ENUM('a', 'b')", dt.string),
("INTEGER", dt.int32),
("INTERVAL", dt.Interval("us")),
("FLOAT", dt.float32),
Expand Down
5 changes: 3 additions & 2 deletions ibis/backends/duckdb/tests/test_geospatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import numpy.testing as npt
import pandas.testing as tm
import pyarrow as pa
import pytest
from packaging.version import parse as vparse
from pytest import param
Expand Down Expand Up @@ -54,7 +53,9 @@ def test_geospatial_dwithin(assert_sql):
"geometry_type",
"geom_type",
id="geometry_type",
marks=pytest.mark.xfail(raises=pa.lib.ArrowTypeError),
marks=pytest.mark.xfail(
raises=AssertionError, reason="capitalization is different"
),
),
],
)
Expand Down
Loading