-
Notifications
You must be signed in to change notification settings - Fork 122
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
validate_all throws KeyError when validating Microsoft Planetary Computer STAC API #343
Comments
This is related to #340 and should raise a more reasonable exception when it encounters a non-STAC object. It looks like this is failing because the Collection at curl https://planetarycomputer.microsoft.com/api/stac/v1/collections/aster-l1t -s | jq ".links[2]"
{
"href": "https://planetarycomputer.microsoft.com/api/stac/v1/collections/aster-l1t/items",
"rel": "item",
"type": "application/geo+json"
} Do we define the |
I can't find a spec mention, but I've seen elsewhere a rel="items" point to the items endpoint. The 'item' reltype is a typo; I'll fix that in a bit! |
OGC Part 1
|
@philvarner Maybe we should add a "Relation types" section to the STAC API - Features docs similar to what we have for Using Relation Types in the core best practices. I think it would be helpful for backend and client implementors to have those collected in one place. |
This still seems like something that should be addressed in PySTAC despite the root cause being a bad rel type in the API. Related to #340 , it seems like |
Agree. I'm not that familiar with the API, so forgive my hand-waviness here, but I would expect that if I tried to get that specific rel= |
This is fixed via #402
@philvarner Maybe this should just raise the same exception. The problem I see with skipping them and raising warnings is that in some automated systems those warnings would just get ignored, which might gloss over problems in a catalog. If we raise the exception downstream applications can just handle that exception in their iterators however they want. |
That sounds fine! |
In that case this is closed via #402 |
The code below throws a KeyError instead of giving a STACValidationError. I think it needs to be more defensive so if the "id" field is missing, and convert the KeyError into a STACValidationError. It's also possible that it's trying to process an entity that's not a STAC object and has no "id" field.
The exception, from
pystac/catalog.py
:The text was updated successfully, but these errors were encountered: