-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fixes failing task tests for new engine #13456
Conversation
src/prefect/new_task_engine.py
Outdated
# We sometimes call this prior to setting up the run context, so we create a temporary | ||
# context here | ||
# TODO: Should we set up the run context earlier in Engine.start? | ||
log_prints = should_log_prints(self.task) | ||
task_run_context = TaskRunContext( | ||
task=self.task, | ||
log_prints=log_prints, | ||
task_run=self.task_run, | ||
parameters=self.parameters, |
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.
This is a hack to get the tests to pass. Should we move the setup of the task run context before calling Engine.begin_run
?
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.
Yep this definitely feels out of place to me too. I think you're right about moving it earlier so we don't have to do this 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.
I added a context setup before beginning the run in 2311030, which worked. We still need to set up the context on each execution to ensure we have the latest task run meta data, but I don't think there's any harm in that.
999259b
to
a18ef14
Compare
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.
Gaining ground!
src/prefect/new_task_engine.py
Outdated
# We sometimes call this prior to setting up the run context, so we create a temporary | ||
# context here | ||
# TODO: Should we set up the run context earlier in Engine.start? | ||
log_prints = should_log_prints(self.task) | ||
task_run_context = TaskRunContext( | ||
task=self.task, | ||
log_prints=log_prints, | ||
task_run=self.task_run, | ||
parameters=self.parameters, |
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.
Yep this definitely feels out of place to me too. I think you're right about moving it earlier so we don't have to do this here
This PR fixes the remaining failing tests for tasks with the new engine. 5 tests still fail because they involve calling async tasks in sync flows or the
SequentialTaskRunner
. Makes a couple of fixes in caching and adds support for input resolution andwait_for
for flows in the new engine.Example
Checklist
<link to issue>
"maintenance
,fix
,feature
,enhancement
,docs
.For documentation changes:
netlify.toml
for files that are removed or renamed.For new functions or classes in the Python SDK:
mkdocs.yml
navigation.