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

Update GranuleLocalities to be of type NotRequired[list[str]] #36

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

gjclark
Copy link
Contributor

@gjclark gjclark commented Feb 12, 2025

I left the NotRequired, but I'm not sure why we're using it.

Copy link
Contributor

@reweeden reweeden left a comment

Choose a reason for hiding this comment

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

NotRequired means that the field is not required, i.e. it can be left out and the UMM-G will still be valid. The JSONSchema is set up such that all of the sub-fields in SpatialExtent are optional so long as you provide any one of them. But in our type annotations we don't have the capability of doing complex validation like that so we just need to make all the fields NotRequired. As a result, an empty dict will pass type checking even though it is not valid for UMM-G, but it's the best we can do.

@gjclark gjclark merged commit c239777 into main Feb 12, 2025
9 checks passed
@gjclark gjclark deleted the gjc/granule-localities branch February 12, 2025 16:58
@gjclark gjclark mentioned this pull request Feb 12, 2025
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.

2 participants