marshmallow-code / marshmallow-sqlalchemy

SQLAlchemy integration with marshmallow
https://marshmallow-sqlalchemy.readthedocs.io
MIT License
557 stars 96 forks source link

update a non-existent field in instance when updating this instance #501

Open beaulian opened 1 year ago

beaulian commented 1 year ago

Hi,

According to the following code, when we update an instance, whatever we define other fields (not in the Model) in the Schema, these fields will be inserted to the instance, is it a bug?

https://github.com/marshmallow-code/marshmallow-sqlalchemy/blob/d4c7479b15a00abc76011b76a6b22db2386d23e1/src/marshmallow_sqlalchemy/load_instance_mixin.py#L73-L76

Thanks

lafrech commented 1 year ago

I would say it is a bug in client code.

Should this lib actively try to catch this?