-
Notifications
You must be signed in to change notification settings - Fork 40
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
Expose Object.hydrate as public API / deprecate Object.resolve #2769
Conversation
Whoops meant to abandon #2770, not this one! |
8899c10
to
495f365
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.
👌
493ff48
to
ab3cb55
Compare
ab3cb55
to
8051d9c
Compare
@prbot approve |
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.
Approved 👍. @freider will follow-up review this.
@@ -517,8 +517,9 @@ async def exec( | |||
raise InvalidError(f"workdir must be an absolute path, got: {workdir}") | |||
|
|||
# Force secret resolution so we can pass the secret IDs to the backend. | |||
# TODO should we parallelize this? |
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.
Yes! cries in eu latencies
elif not self._hydrate_lazily: | ||
# TODO(michael) can remove _hydrate lazily? I think all objects support it now? |
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.
Everything except locally defined Functions and Classes (as defined by the function and cls decorators)
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
Describe your changes
We are deprecating the
Object.lookup
method, which eagerly hydrates the object upon construction, in favor of the following pattern:Object.from_name
and rely on operations triggering on-demand hydrationObject.hydrate()
method.The
.hydrate
method replaces the existing.resolve
method. The new name was introduced because we have more commonly used "hydration" terminology (i.e. in error messages) and it is more accurate given the current Modal object model. The new method is marginally more user-friendly, e.g. it returns self so it can be called fluently.Part of CLI-96
Backward/forward compatibility checks
Check these boxes or delete any item (or this section) if not relevant for this PR.
Note on protobuf: protobuf message changes in one place may have impact to
multiple entities (client, server, worker, database). See points above.
Changelog
.hydrate
, for on-demand hydration of Modal objects. This method replaces the existing semi-public.resolve
method, which is now deprecated.