-
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
Add PrefectFuture
implementation for flow runs
#17234
Conversation
CodSpeed Performance ReportMerging #17234 will not alter performanceComparing Summary
|
src/prefect/futures.py
Outdated
return self._task_run_id | ||
|
||
@property | ||
def state(self) -> State: | ||
"""The current state of the task run associated with this future""" | ||
warnings.warn( | ||
"The state property of PrefectFuture is deprecated and will be removed in a future release. " | ||
"If you are subclassing PrefectFuture, please implement the state property in your subclass.", |
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.
is it worth pointing these folks to the new class?
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 is the plan for these to raise NotImplemented
errors in the future?
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.
Yeah, I can point to the new class. The plan is to remove these methods from PrefectFuture
and let subclasses manage their implementation.
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.
Updated in 68fcc8d
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.
lgtm!
This PR adds a
PrefectFuture
implementation for tracking flow run execution that works similarly to thePrefectDistributedFuture
for task runs. To support the operation of the newPrefectFlowRunFuture
, this PR also adds aFlowRunWaiter
to monitor the execution of flow runs via events.To make the inheritance hierarchy of
PrefectFuture
make a little more sense, I also added aPrefectTaskRunFuture
class to hold some of the implementations that were onPrefectFuture
so thatPrefectFuture
can be purely an interface and not a Frankenstein class. The implementations onPrefectFutrue
have been deprecated and should be removed in a later release. This should only affect users that might be subclassingPrefectFuture
.This new future type will be used to track flow runs submitted to remote infrastructure via a worker.
Related to #17194