Skip to content

Commit

Permalink
fix python compile
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron committed Dec 10, 2024
1 parent 627e134 commit f2758ae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
5 changes: 1 addition & 4 deletions python/pyo3-geoarrow/src/data_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ impl PyNativeType {
coord_type.unwrap().into(),
dimension.unwrap().into(),
))),
"geometry" => Ok(Self(NativeType::Mixed(
coord_type.unwrap().into(),
dimension.unwrap().into(),
))),
"geometry" => Ok(Self(NativeType::Geometry(coord_type.unwrap().into()))),
"geometrycollection" => Ok(Self(NativeType::GeometryCollection(
coord_type.unwrap().into(),
dimension.unwrap().into(),
Expand Down
3 changes: 1 addition & 2 deletions python/pyo3-geoarrow/src/ffi/from_python/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::sync::Arc;

use crate::array::*;
use crate::scalar::*;
use geoarrow::array::MixedGeometryArray;
use geoarrow::datatypes::Dimension;
use geoarrow::io::geozero::ToMixedArray;
use geoarrow::scalar::GeometryScalar;
Expand All @@ -26,7 +25,7 @@ impl<'a> FromPyObject<'a> for PyGeometry {
let reader = GeoJsonString(json_string);

// TODO: we need a dynamic dimensionality reader
let arr: MixedGeometryArray = reader
let arr = reader
.to_mixed_geometry_array(Dimension::XY)
.map_err(|err| PyValueError::new_err(err.to_string()))?;
Ok(Self(
Expand Down
2 changes: 1 addition & 1 deletion rust/geoarrow/src/array/mixed/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ impl ArrayBase for MixedGeometryArray {
if array_metadata.should_serialize() {
metadata.insert(
"ARROW:extension:metadata".to_string(),
serde_json::to_string(array_metadata).unwrap(),
serde_json::to_string(array_metadata.as_ref()).unwrap(),
);
}
Arc::new(Field::new(name, data_type, nullable).with_metadata(metadata))
Expand Down

0 comments on commit f2758ae

Please sign in to comment.