Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Jul 13, 2024
1 parent 9507bdc commit 3ba384d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ibis/formats/pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ def to_ibis(cls, typ: pa.DataType, nullable=True) -> dt.DataType:
return dt.Map(key_dtype, value_dtype, nullable=nullable)
elif pa.types.is_dictionary(typ):
return cls.to_ibis(typ.value_type)
elif isinstance(typ, pa.ExtensionType) and type(typ).__name__ == "GeometryExtensionType":
elif (
isinstance(typ, pa.ExtensionType)
and type(typ).__name__ == "GeometryExtensionType"
):
from geoarrow import types as gat

Check warning on line 108 in ibis/formats/pyarrow.py

View check run for this annotation

Codecov / codecov/patch

ibis/formats/pyarrow.py#L108

Added line #L108 was not covered by tests

gat.type_pyarrow.register_extension_types()

Check warning on line 110 in ibis/formats/pyarrow.py

View check run for this annotation

Codecov / codecov/patch

ibis/formats/pyarrow.py#L110

Added line #L110 was not covered by tests
Expand Down
4 changes: 3 additions & 1 deletion ibis/formats/tests/test_pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,6 @@ def test_unknown_dtype_gets_converted_to_string():
def test_geo_gets_converted_to_geoarrow(ibis_type):
type_pyarrow = pytest.importorskip("geoarrow.types.type_pyarrow")

assert isinstance(PyArrowType.from_ibis(ibis_type), type_pyarrow.GeometryExtensionType)
assert isinstance(
PyArrowType.from_ibis(ibis_type), type_pyarrow.GeometryExtensionType
)

0 comments on commit 3ba384d

Please sign in to comment.