geoarrow-rs icon indicating copy to clipboard operation
geoarrow-rs copied to clipboard

serde serialization of crs and edges should be skipped when None

Open JosiahParry opened this issue 1 year ago • 1 comments

Per https://github.com/geoarrow/geoarrow-r/issues/34#issuecomment-1925872634 crs and edges shouldn't return null when not set. Rather, they should be omitted. This can be configured with serde #[serde(skip_serializing_if = "Option::is_none")] on the Option field

https://github.com/geoarrow/geoarrow-rs/blob/eb94df3d998801be3c55128b4535fc9f58652b66/src/array/metadata.rs#L28-L32

JosiahParry avatar Feb 04 '24 18:02 JosiahParry

good to know about that serde option but we should be checking if all fields are null and not even writing the metadata key in that case

kylebarron avatar Feb 04 '24 18:02 kylebarron

This is solved now. Helped by https://github.com/geoarrow/geoarrow-rs/pull/719 but solved separately before that I think.

kylebarron avatar Aug 27 '24 02:08 kylebarron