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
hydrate
None
The tests for pypgstac make it seem like the hydrate function is expected to be able to treat a None value as if it were an empty dictionary:
pypgstac
def test_base_none(self) -> None: base_item = {"value": None} dehydrated = {"value": {"a": "b"}} hydrated = self.hydrate(base_item, dehydrated) assert hydrated == {"value": {"a": "b"}}
See the relevant code here: `https://github.com/stac-utils/pgstac/blob/6c569c0ee56bd9519ad947cbcaa8bfbcfade15bb/src/pypgstac/tests/hydration/test_hydrate.py#L241-L245
Right now, the hydrate function does not do that. Instead it tries to downcast the None value to a dict and raises an error since it can't do that:
hydraters/src/lib.rs
Lines 42 to 49 in d3946d3
Do we want to change the code here so that if item or base is None, we convert it to a dict or list? Or if not, we should update the tests in pgstac.
item
base
What do you think?
The text was updated successfully, but these errors were encountered:
src
Yup, I'll update — I must have pulled the test suite from somewhere else so I didn't get stac-utils/pgstac#263. Thanks for the catch.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
The tests for
pypgstac
make it seem like thehydrate
function is expected to be able to treat a None value as if it were an empty dictionary:See the relevant code here: `https://github.com/stac-utils/pgstac/blob/6c569c0ee56bd9519ad947cbcaa8bfbcfade15bb/src/pypgstac/tests/hydration/test_hydrate.py#L241-L245
Right now, the
hydrate
function does not do that. Instead it tries to downcast theNone
value to a dict and raises an error since it can't do that:hydraters/src/lib.rs
Lines 42 to 49 in d3946d3
Do we want to change the code here so that if
item
orbase
is None, we convert it to a dict or list? Or if not, we should update the tests in pgstac.What do you think?
The text was updated successfully, but these errors were encountered: