-
Notifications
You must be signed in to change notification settings - Fork 552
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 ExecutionOptions to execute_operator() #3850
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## release/v0.23.0 #3850 +/- ##
===================================================
- Coverage 15.56% 15.56% -0.01%
===================================================
Files 729 729
Lines 80994 81365 +371
Branches 1075 1085 +10
===================================================
+ Hits 12609 12661 +52
- Misses 68385 68704 +319
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
fiftyone/operators/operator.py
Outdated
resolved_delegation = self.resolve_delegation(ctx) | ||
if resolved_delegation is None: | ||
# legacy behavior | ||
if resolved_delegation is not None: |
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.
@ritch this is the key change: if resolve_delgation() != None
, then we rely on it to set ExecutionOptions
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.
Excellent 👍
|
||
if params is None: | ||
params = ctx.get("params", {}) | ||
ctx = {**ctx, **kwargs} # don't modify input `ctx` in-place |
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.
@ritch this is the other key change: it allows for request_delegation
and delegation_target
to be correctly passed through to the ExecutionContext
using either of these syntaxes:
foo.execute_operator(..., ctx={"request_delegation": True, ...})
foo.execute_operator(..., request_delegation=True)
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.
Great - and I'm assuming this is backwards compatible. Doesn't appear to be but I would be surprised if you missed that.
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, backwards compatible 👍
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.
Nice! Thank you 🙏
Change log
request_delegation
anddelegation_target
toexecute_operator()
resolve_execution_options()
andset_progress()
methodsNote: if a user passes
request_delegation=True
but the operator doesn't support delegated execution, it will log a warning and just execute immediately instead: