Embedded Model Exclude None Not Functioning
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Description
# Bug
Using 'exclude_none' in .update function does not work for fields in embedded models
### Current Behavior
Create 'model' with embedded model in field. Use 'exclude_none' in 'model.update(*, exclude_none=True). Field with non-null value becomes null in embedded model.
### Expected behavior
Fields in embedded model should not change from a non-null value to a null if exclude_none is set to True.
### Environment
- ODMantic version: odmantic==0.8.0
Contributor guide
Research direction
Start at the model.update(..., exclude_none=True) path and reproduce the embedded-model case described in the issue. Trace how None values are handled during the update and verify that an existing non-null embedded field remains unchanged when exclude_none is enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, python
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100