model cleanup#2129
Open
hramrach wants to merge 8 commits into
Open
Conversation
Contributor
hramrach
commented
Apr 30, 2026
- only produce one JSON format, there is no use for the bespoke format that is not reproducible with other tools
- abolish NotSetClass
The field is not optional, and requires a default to be able to correctly instantiate the model without additional parameters.
This is fairly impractical, and there is no real reason.
The NotSet object is not a singleton, it is required to check the class.
The default for users and groups is None which is not useful in any way.
The Optional constructor is union with None. As a result optional fields are set to None when not present. Ignore them in dict().
There is no user that requires this bespoke format
As NotSet and None is used interchangeably 'for usability' NotSet can as well be abolished, it only makes the code more confusing. There is no representation of None in XML, and no protocol that uses JSON requires a null value, there is no use for NotSet separate from None. If an actual NotSet value separate from None is needed it should be implemented correctly, so that it is usable without substituting with None.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2129 +/- ##
==========================================
- Coverage 33.94% 33.92% -0.03%
==========================================
Files 199 199
Lines 27035 27025 -10
==========================================
- Hits 9177 9167 -10
Misses 17858 17858 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.