diff --git a/tiledb/datatypes.py b/tiledb/datatypes.py index e6d2690179..de47506d3f 100644 --- a/tiledb/datatypes.py +++ b/tiledb/datatypes.py @@ -24,13 +24,11 @@ def from_numpy(cls, dtype: np.dtype) -> DataType: if dtype == "blob": return cls(np.dtype("S"), lt.DataType.BLOB, 1) - if hasattr(lt.DataType, "GEOM_WKB"): - if dtype == "wkb": - return cls(np.dtype("S"), lt.DataType.GEOM_WKB, 1) + if hasattr(lt.DataType, "GEOM_WKB") and dtype == "wkb": + return cls(np.dtype("S"), lt.DataType.GEOM_WKB, 1) - if hasattr(lt.DataType, "GEOM_WKT"): - if dtype == "wkt": - return cls(np.dtype("S"), lt.DataType.GEOM_WKT, 1) + if hasattr(lt.DataType, "GEOM_WKT") and dtype == "wkt": + return cls(np.dtype("S"), lt.DataType.GEOM_WKT, 1) dtype = np.dtype(dtype) if dtype.kind == "V":