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

schema: fix data reference update in pre_load #561

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

yashlamba
Copy link
Member

There seems to an issue with marshmallow that they are not freezing the original data which causes potential modifications leading to an updated copy of the object on subsequent pre/validate/post calls.

https://github.com/marshmallow-code/marshmallow/blob/13a12ad2eed262933770c643febbc46d4905c4c9/src/marshmallow/schema.py#L851-L853

This is work around for that for this specific case inveniosoftware/invenio-communities#1088 where we need to use pass_original.

@yashlamba yashlamba requested a review from jrcastro2 February 15, 2024 13:47
Copy link
Contributor

@jrcastro2 jrcastro2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks a lot for this fix 🚀 I think it would be good if we can fix it in all other places that manipulate the data using the pre_load, such as here

I would check in all places and apply the same fix so that we don't waste time in the future with this issue 😉

@slint slint merged commit 3cc509a into inveniosoftware:master Feb 16, 2024
12 checks passed
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

Successfully merging this pull request may close these issues.

4 participants