Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't serialize empty array metadata #498

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kylebarron
Copy link
Member

@kylebarron kylebarron commented Feb 4, 2024

Supersedes #497 ; progress for #430

@kylebarron
Copy link
Member Author

hmm looks like I have some issues with the union handling :/

let dt = GeoDataType::Point(CoordType::Interleaved);
let field = dt.to_field("field_name", true, None);
assert_eq!(field.metadata().len(), 1);
assert!(field.metadata().contains_key("ARROW:extension:name"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I misunderstood one of your comments about the {}...I am pretty sure that geoarrow-c will serialize empty metadata as {}, even though the spec says to omit the key. I do think having a canonical way to represent "no metadata" is helpful (so that non-geo-aware libraries see the schemas as equal); however, it definitely doesn't cause a problem as I might have suggested 😬

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok. Just the changes in #497 would change {"crs": null} to {}. The attempted changes in this PR would omit the key entirely from the metadata. I think we can consume either input

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants