You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling, for instance, pystac.extensions.eo.EOExtension.ext on an Item that does not have the EO schema URI in its stac_extensions list will succeed and return an ItemEOExtension instance. You can then read and write fields like eo:cloud_cover even though the Item doesn't actually implement that extension.
It seems like the desired behavior here would be to raise an exception when using ext on an object that does not implement that extension for 2 reasons:
When using PySTAC to read existing STAC Items, this could mask a problem with an invalid object
This will interfere with the edge case where a user has custom fields with a prefix that overlaps with one of the extensions (maybe because the custom fields predate the extension). In this case, the fields should not be treated as if they are defined by the extension.
Originally raised as part of this PR comment in stac-utils/stactools