Skip to content
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

Make attrs JSON serializable #30

Open
TomAugspurger opened this issue Jan 27, 2022 · 0 comments
Open

Make attrs JSON serializable #30

TomAugspurger opened this issue Jan 27, 2022 · 0 comments

Comments

@TomAugspurger
Copy link
Collaborator

xstac will insert the attrs into each variable into the STAC item / collection. These attrs are not always JSON serializable, causing validation to fail.

The workaround is for users to manually call

    for k, v in ds.variables.items():
        attrs = {name: xr.backends.zarr.encode_zarr_attr_value(value) for name, value in v.attrs.items()}
        ds[k].attrs = attrs

we could do this for them.

@ghidalgo3 ghidalgo3 mentioned this issue Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant