-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fixup attrs #40
Fixup attrs #40
Conversation
Thanks, would you mind adding a simple test for this so we don't regress on it in the future? Also, I'll make you a maintainer here. But I apparently don't have admin so I'll need an owner on stac-utils to make me an admin. Maybe @lossyrob could help with that? I think https://github.com/stac-utils/xstac/settings is the URL. |
Added both of you as admins. |
Thanks, Tom and Rob! Added a unit test that reprod the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice teamwork :)
tests/test_xstac.py
Outdated
try: | ||
import json | ||
json.dumps(result.to_dict()) | ||
except Exception: | ||
pytest.fail("Failed to serialize to JSON") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move the JSON import to the top and then just do json.dumps(result.to_dict())
in the test? No need to catch the exception. An unhandled one will cause the test to fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Looks like a CI failure on linting: https://github.com/stac-utils/xstac/actions/runs/10527664242/job/29173634803?pr=40#step:6:23. Might want to do a |
Thanks! LMK if a release would be helpful, it should just require a new release on GitHub and PyPI will be automated from there. |
I will probably get a few more PRs into |
Addresses #30 ,
xarray
tends to putnumpy
arrays inattrs
which are not immediately JSON serializable.