We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
pystac.extensions.file.MappingObject is broken and/or the docs should not specify to use it. An example:
pystac.extensions.file.MappingObject
from pystac.extensions.file import FileExtension, MappingObject FILE_SIZE = 100 VALUES = { 1: "Temperate or sub-polar needleleaf forest", 2: "Sub-polar taiga needleleaf forest", 3: "Tropical or sub-tropical broadleaf evergreen forest", ... } values: List[MappingObject] = [ MappingObject.create(values=[i], summary=s) for i, s in VALUES.items() ] file_ext = FileExtension.ext(data_asset, add_if_missing=True) file_ext.apply(size=FILE_SIZE, values=values)
results in
TypeError: Object of type MappingObject is not JSON serializable
when saving the STAC. The following change is a viable workaround:
values: List[Any] = [ dict(values=[i], summary=s) for i, s in VALUES.items() ]
The text was updated successfully, but these errors were encountered:
The fix is to make the values setter here "unbox" the MappingObject in a similar fashion as is done here
values
Sorry, something went wrong.
duckontheweb
Successfully merging a pull request may close this issue.
pystac.extensions.file.MappingObject
is broken and/or the docs should not specify to use it. An example:results in
when saving the STAC. The following change is a viable workaround:
The text was updated successfully, but these errors were encountered: