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

Improves Covering Schema #208 #209

Merged
merged 6 commits into from
May 29, 2024
Merged

Improves Covering Schema #208 #209

merged 6 commits into from
May 29, 2024

Conversation

m-mohr
Copy link
Collaborator

@m-mohr m-mohr commented Apr 27, 2024

Fixes #208

Copy link
Collaborator

@jwass jwass left a comment

Choose a reason for hiding this comment

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

This looks good to me. Two thoughts:

  • Add an invalid example to scripts/test_json_schema.py to show that empty name as the first column name will fail.
  • bbox is now required but should additional properties be allowed per your comment in Covering Schema #208? If so, you could add additionalProperties: false to covering... but maybe it's fine to leave for now.

@m-mohr
Copy link
Collaborator Author

m-mohr commented Apr 28, 2024

Tests added.

bbut should additional properties be allowed per your comment in https://github.com/opengeospatial/
geoparquet/issues/208?

I'm not sure what the intention was here. How it is in this PR it seems most reasonable to me, but maybe there was another intention. I hope others can clarify.

Comment on lines +77 to +79
"required": [
"bbox"
],
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we want to make this required if we want to add other covering types in the future. Or would we remove this required when we add the future covering type?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or is there some way to define the specific key names allowed? E.g. that today we only allow the "bbox" key inside coverings, but that in the future other keys may be allowed as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, that's the question. I mean right now it's required, isn't it? Otherwise it's empty or someone puts anything else.

In the future the requirement could be relaxed of course, but for 1.1 it doesn't feel very useful to not require it?!

With regards to your second comment, I'm not sure I understand what you are looking for.

Copy link
Collaborator

Choose a reason for hiding this comment

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

With regards to your second comment, I'm not sure I understand what you are looking for.

My understanding is that your change means that a bbox key is now required. Instead, is there some way in JSON schema to allow an enum of values? So we currently define an enum with a single variant but can expand that in the future?

Copy link
Collaborator Author

@m-mohr m-mohr Apr 29, 2024

Choose a reason for hiding this comment

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

You could do something like the following to indicate that you expect more fields in the future where having one of them is required:

"anyOf": [
  { "required": ["bbox"] }
]

It's not really different though, it's just an implicit indication for people reading the schema.

The question really is:

Are covering: {} or e.g. covering: { a: "b" } something that should be allowed in 1.1? Or do we always expect that in 1.1 there is a bbox member in covering? I couldn't really figure out what the intention is...

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the expectation is that if the covering key exists, then it has a bbox member key.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Then the PR is correct. If you want I can update it to the anyOf, I'm pretty neutral on it. What do others think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed. I think it's fine as-is. Whenever more options are added, the "required": ["bbox"] can change to anyOf or oneOf without losing the meaning. And since only the outermost element has additionalProperties set to false, it seems consistent to leave it out here.

@cholmes cholmes added this to the 1.1 milestone May 2, 2024
@m-mohr m-mohr requested review from jwass and rouault May 20, 2024 17:36
@cholmes
Copy link
Member

cholmes commented May 28, 2024

What's the status of this one? @jwass - you want to give this an approval? Let's get this one merged in unless anyone has objections.

@cholmes cholmes merged commit 00bb0ed into main May 29, 2024
2 checks passed
@cholmes cholmes deleted the m-mohr-patch-1 branch May 29, 2024 02:58
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.

Covering Schema
5 participants