-
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
call FlowRunContext.model_rebuild()
in hydrate_context
#16628
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #16628 will not alter performanceComparing Summary
|
4996488
to
45678e2
Compare
src/prefect/context.py
Outdated
@@ -81,6 +82,7 @@ def hydrated_context( | |||
if flow_run_context := serialized_context.get("flow_run_context"): | |||
flow = flow_run_context["flow"] | |||
task_runner = stack.enter_context(flow.task_runner.duplicate()) | |||
FlowRunContext.model_rebuild(_types_namespace=_types) |
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.
open to better ways to do this (if possible)
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.
I think only Flow
is needed for this rebuild, so it might be worthwhile only to import Flow
and pass it into _types_namespace
.
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.
that's what I expected as well, and did at first, but unfortunately that doesn't fix the problem. we see the same unpickleable error
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.
Hmm, well if we're importing _types
, we might as well just import prefect.main
which would allow us to remove the explicit model_rebuild
call here.
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.
and the circle continues
3d48892
to
0f042e4
Compare
remove comment restore comment
0f042e4
to
d50e605
Compare
fixes
EngineContext
rebuild error, which when occurring was causing this downstream error, as the pydantic error could not be serializedand assorted typing improvements