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

recursion error on json dumping #15

Open
sneakers-the-rat opened this issue Sep 27, 2024 · 1 comment
Open

recursion error on json dumping #15

sneakers-the-rat opened this issue Sep 27, 2024 · 1 comment

Comments

@sneakers-the-rat
Copy link
Contributor

Think we're gonna have to serialize each of the items independently and stitch them together.

Pydantic doesn't like models that reference each other, even when they have json serializations that handle that - the mere presence of a repeated object ID causes the json serialization to choke in a way that can be sometimes rescued by a model_serializer(mode="wrap") but other times doing so causes the next dump attempt to fail.

Some of these are actually cyclical recursion errors, some of them (like object ID columns, which never reference other objects) are getting independent cyclical errors (not the errors of the parent class which may have already been seen, an additional error) may be related to: pydantic/pydantic#9670

We could just.... load objects twice. there isn't really a reason to only load a single object except that it simplifies writing if eg. incompatible edits are made to the attributes of the referenced object (the array should be fine, since it refers tot he same underlying hdf5 dataset)

@sneakers-the-rat
Copy link
Contributor Author

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