-
-
Notifications
You must be signed in to change notification settings - Fork 380
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
feat: rework and simplify DTOs #2088
feat: rework and simplify DTOs #2088
Conversation
819e0a7
to
c9a8888
Compare
This is a monster ._. 👹 |
Not quite done yet... |
39cc377
to
a38aad7
Compare
Qodana Community for Python21 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
a38aad7
to
aaba865
Compare
aaba865
to
df78850
Compare
87df79d
to
1d5b7aa
Compare
1d5b7aa
to
1693db7
Compare
tests/unit/test_contrib/test_sqlalchemy/test_serialization_plugin.py
Outdated
Show resolved
Hide resolved
tests/unit/test_contrib/test_sqlalchemy/test_serialization_plugin.py
Outdated
Show resolved
Hide resolved
docs/examples/contrib/sqlalchemy/plugins/tutorial/full_app_with_init_plugin.py
Outdated
Show resolved
Hide resolved
tests/unit/test_contrib/test_piccolo_orm/test_piccolo_orm_dto.py
Outdated
Show resolved
Hide resolved
tests/unit/test_handlers/test_websocket_handlers/test_listeners.py
Outdated
Show resolved
Hide resolved
tests/unit/test_handlers/test_websocket_handlers/test_validations.py
Outdated
Show resolved
Hide resolved
f31e427
to
5f11208
Compare
Co-authored-by: Janek Nouvertné <25355197+provinzkraut@users.noreply.github.com>
7b6c274
to
617e1fe
Compare
Co-authored-by: Janek Nouvertné <25355197+provinzkraut@users.noreply.github.com>
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long review time on this. It's a big one, but other than the current comments, it LGTM.
Sorry for the delay (Well that's funny timing and phrasing 🤣... trying to finish from my phone) |
By the time the signature model is parsed, the DTO has already validated and built the object to be injected as `data`, so we don't need the signature model to do it again. This PR ensures that `data` fields are typed as `Any` on the signature model so that validation doesn't occur twice. This is a regression introduced in #2088, so I've added an explicit test for it. Closes #2149
By the time the signature model is parsed, the DTO has already validated and built the object to be injected as `data`, so we don't need the signature model to do it again. This PR ensures that `data` fields are typed as `Any` on the signature model so that validation doesn't occur twice. This is a regression introduced in #2088, so I've added an explicit test for it. Closes #2149
By the time the signature model is parsed, the DTO has already validated and built the object to be injected as `data`, so we don't need the signature model to do it again. This PR ensures that `data` fields are typed as `Any` on the signature model so that validation doesn't occur twice. This is a regression introduced in #2088, so I've added an explicit test for it. Closes #2149
This PR does the following:
DTOInterface
class, which was both unnecessary and problematic - all DTOs must include the logic that is on the base DTO class, and this was wrong.AbstractDTOFactory
intoAbstractDTO
- this is more correct since all its subclasses are calledDataclassDTO
,MsgspecDTO
etc.ForType
and the logic associated with it - this is no longer necessary and it just added complication.The following are breaking changes:
DTOInterface
ForType
AbstractDTOFactory
->AbstractDTO
builtins_to_data_type
andbytes_to_data_type
withdecode
data_to_encodable_type
withencode
It closes:
#2018
#1929
This is the last change to DTOs before we go for release. From this point onward its only bug fixes.
Apologies for the scale of this PR - it required a rather deep dive to fully work out the code and simplify it.