Issue with latest version of simplestac
Hello, I'm having issues with the latest version of simplestac (v1.2.4). When trying to create a collection from local files with specific products, I get the following error:
jsonschema.exceptions.ValidationError: [nan, nan, nan, nan] should not be valid under {}
Failed validating 'not' in schema[1]['properties']['bbox']:
{'not': {}}
On instance['bbox']:
[nan, nan, nan, nan]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/work/THEIA/CES/oso/eugene/lambda/src/pylambda/pipeline.py", line 203, in <module>
main()
File "/work/THEIA/CES/oso/eugene/lambda/src/pylambda/pipeline.py", line 138, in main
build_collection_from_image_dir(images_dir, collection_path)
File "/work/THEIA/CES/oso/eugene/lambda/src/pylambda/utils.py", line 184, in build_collection_from_image_dir
coll = build_item_collection(image_dir, collection_format("S2_L2A_THEIA"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/THEIA/CES/oso/eugene/lambda/.pixi/envs/default/lib/python3.12/site-packages/simplestac/local.py", line 756, in build_item_collection
item_creator.create_item(item, validate=validate)
File "/work/THEIA/CES/oso/eugene/lambda/.pixi/envs/default/lib/python3.12/site-packages/simplestac/local.py", line 665, in create_item
item.validate()
File "/work/THEIA/CES/oso/eugene/lambda/.pixi/envs/default/lib/python3.12/site-packages/pystac/stac_object.py", line 80, in validate
return pystac.validation.validate(self, validator=validator)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/THEIA/CES/oso/eugene/lambda/.pixi/envs/default/lib/python3.12/site-packages/pystac/validation/__init__.py", line 54, in validate
return validate_dict(
^^^^^^^^^^^^^^
File "/work/THEIA/CES/oso/eugene/lambda/.pixi/envs/default/lib/python3.12/site-packages/pystac/validation/__init__.py", line 133, in validate_dict
return validator.validate(
^^^^^^^^^^^^^^^^^^^
File "/work/THEIA/CES/oso/eugene/lambda/.pixi/envs/default/lib/python3.12/site-packages/pystac/validation/stac_validator.py", line 116, in validate
core_result = self.validate_core(
^^^^^^^^^^^^^^^^^^^
File "/work/THEIA/CES/oso/eugene/lambda/.pixi/envs/default/lib/python3.12/site-packages/pystac/validation/stac_validator.py", line 261, in validate_core
self._validate_from_uri(stac_dict, stac_object_type, schema_uri, href=href)
File "/work/THEIA/CES/oso/eugene/lambda/.pixi/envs/default/lib/python3.12/site-packages/pystac/validation/stac_validator.py", line 224, in _validate_from_uri
raise STACValidationError(msg, source=errors) from best
pystac.errors.STACValidationError: Validation failed for Feature with ID SENTINEL2B_20181229-104840-537_L2A_T31TDK_C_V2-2_PVD_ALL against schema at https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json
[nan, nan, nan, nan] should not be valid under {}
Failed validating 'not' in schema[1]['properties']['bbox']:
{'not': {}}
On instance['bbox']:
[nan, nan, nan, nan]
From what I tested this error happens with V2 products but not V4, e.g.:
- V2:
SENTINEL2A_20180207-104643-047_L2A_T31TDH_C_V2-2=> crashes - V4:
SENTINEL2A_20250907-103834-782_L2A_T31TGL_C_V4-0=> no issue
When switching back to simplestac v1.2.3, I no longer have the issue. This behavior was confirmed by other users.
I noticed the change of version in !15 (merged), maybe this could be related ?
Edited by Eugene Planteur