From 3ba384ddc7b495edaff109c81b0128f9a8af92b5 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Sat, 13 Jul 2024 05:47:09 +0000 Subject: [PATCH] format --- ibis/formats/pyarrow.py | 5 ++++- ibis/formats/tests/test_pyarrow.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ibis/formats/pyarrow.py b/ibis/formats/pyarrow.py index 27d3cffd243e2..c719e1380c5be 100644 --- a/ibis/formats/pyarrow.py +++ b/ibis/formats/pyarrow.py @@ -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 gat.type_pyarrow.register_extension_types() diff --git a/ibis/formats/tests/test_pyarrow.py b/ibis/formats/tests/test_pyarrow.py index fcc0d00862772..3579e7724c955 100644 --- a/ibis/formats/tests/test_pyarrow.py +++ b/ibis/formats/tests/test_pyarrow.py @@ -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 + )