-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
make re-usable TypeAdapter
instances for client schemas
#16089
Conversation
CodSpeed Performance ReportMerging #16089 will not alter performanceComparing Summary
|
this does makes sense, since we're making all of the adapters at import time, but I think this is worth it |
TypeAdapter
instances for client schemas
7654e26
to
c2420ee
Compare
c2420ee
to
36ed5ac
Compare
3e06bdb
to
db7bfe8
Compare
BaseResult.model_rebuild() | ||
ResultRecordMetadata.model_rebuild() | ||
|
||
State.model_rebuild() |
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.
We do this in prefect.main
too. Do we need to rebuild again here? Or is there a way that we could conditionally rebuild?
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.
if I don't then I get errors like this
FAILED tests/client/test_prefect_client.py::test_set_then_read_flow_run_state - pydantic.errors.PydanticUndefinedAnnotation: name 'State' is not defined
though I agree it seems like it shouldn't be needed 🤔
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.
ill make a discussion to investigate this
db7bfe8
to
b442d2d
Compare
moves creation of type adapters out of client method impls
related to #15047
uses
defer_build
as pointed out by adam below