-
Notifications
You must be signed in to change notification settings - Fork 123
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
Permissively deserialize invalid temporal extents #1221
Comments
Looks like (at least) one of their collections has invalid temporal extents, and needs to be corrected on their side: $ curl -s https://maxar-opendata.s3.amazonaws.com/events/BayofBengal-Cyclone-Mocha-May-23/collection.json | jq .extent.temporal.interval
[
"2023-01-03 04:30:17Z",
"2023-05-22 04:35:25Z"
]
That being said, this is a common problem. On deserialization, we should probably permissively correct the problem with a warning. Leaving this open to track that need. |
@giswqs just checked your test script against #1222 and looks like it's a fix: $ cat > test.py
from pystac import Catalog
url = "https://maxar-opendata.s3.amazonaws.com/events/catalog.json"
root_catalog = Catalog.from_file(url)
collections = root_catalog.get_collections()
collections = [collection.id for collection in collections]
$ python test.py
/Users/gadomski/Code/stac-utils/pystac/pystac/collection.py:264: UserWarning: A collection's temporal extent should be a list of lists, but is instead a list of strings. pystac is fixing this issue and continuing deserialization, but note that the source collection is invalid STAC.
warnings.warn(
$ So you can work from that branch until we're able to release an update. |
@gadomski Awesome! Thank you very much for the quick fix. |
I have been using the following code to process the Maxar Open Data catalog for several months now. It has been working until today. Now it throws a
ValueError: ISO string too short
. I am not sure if this a pystac or isoparser issue.The text was updated successfully, but these errors were encountered: