Closed
Description
If many items are converted to a table, and then converted back to dictionaries, any missing assets are converted to None
(which is invalid STAC):
import pystac
import stac_geoparquet
from pystac import Item
item: Item = pystac.read_file(
"https://raw.githubusercontent.com/radiantearth/stac-spec/v1.0.0/examples/simple-item.json"
)
reduced_item = item.full_copy()
del reduced_item.assets["thumbnail"]
table = stac_geoparquet.arrow.parse_stac_items_to_arrow([item, reduced_item])
items = list(stac_geoparquet.arrow.stac_table_to_items(table))
assert items[1]["assets"][
"thumbnail"
], f"the thumbnail asset is {items[1]['assets']['thumbnail']}"
Output:
Traceback (most recent call last):
File "check.py", line 13, in <module>
assert items[1]["assets"][
^^^^^^^^^^^^^^^^^^^
AssertionError: the thumbnail asset is None
Metadata
Metadata
Assignees
Labels
No labels