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

Fix Tables schema for empty layers #441

Merged
merged 3 commits into from
Nov 16, 2024
Merged

Fix Tables schema for empty layers #441

merged 3 commits into from
Nov 16, 2024

Conversation

evetion
Copy link
Collaborator

@evetion evetion commented Nov 12, 2024

Fixes #440

This lets Tables.schema return an actual schema, but only when no features are present.

If we always use the schema, we would need to also determine whether features attributes (columns) can be missing, and set the types accordingly. Without scanning all data (which is bad), this would result in all isnullable fields becoming Union{Missing,T} (also bad).

@evetion evetion changed the title Fix empty layer handling Fix Tables schema for empty layers Nov 12, 2024
Copy link
Owner

@yeesian yeesian left a comment

Choose a reason for hiding this comment

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

Thanks for this! Can we also add a test for it in https://github.com/yeesian/ArchGDAL.jl/blob/master/test/test_tables.jl ?

@evetion
Copy link
Collaborator Author

evetion commented Nov 15, 2024

Thanks for this! Can we also add a test for it in master/test/test_tables.jl ?

Done! And I fixed some macros, as interpolating did not work correctly (most @ogrerr statements don't interpolate their string message, but deletefeature! does.

Copy link
Owner

@yeesian yeesian left a comment

Choose a reason for hiding this comment

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

It looks great, thank you!

@yeesian yeesian merged commit 2e0a4a7 into master Nov 16, 2024
8 of 12 checks passed
@yeesian yeesian deleted the fix/empty-layer branch November 16, 2024 02:36
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.

Empty layer has incorrect schema
2 participants