-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ext] Use MaterializeResult for ext_protocol (#16624)
## Summary & Motivation Make ext rely on yielding `MaterializeResult` to register metadata and data version, as opposed to modifying `OpExecutionContext`. This allows results to stream back as they are reported rather than being bulk reported when computation completes. This required addition of a `report_asset_materialization` method that can be called on the `ExtContext`. This will queue a `MaterializationResult` on the orchestration side. The queue can be cleared from the `ExtOrchestrationContext` at any time by calling `ExtOrchestrationContext.get_results`. Errors are raised if attempting materialize an asset twice or report data version/metadata after materialization. Once the `ext_protocol` block exits, any as-yet-unmaterialized assets are queued on the `MessageHandler`, so that calling `ExtOrchestrationContext.get_results` after exit will yield all the remaining `MaterializeResult` objects. Note that yielding from this method after `ext_protocol` close is required to guarantee all buffered data is yielded, since there is no guarantee that all messages have been processed before `ext_protocol` completes its exit routine. To head off the confusing scenario where a user forgets to yield outside the block and sees auto-created materializations that lack any reported metadata, we call `set_require_typed_event_stream` on the `OpExecutionContext`. This will cause an error during output processing if an expected output was not returned/yielded. ## How I Tested These Changes New unit tests.
- Loading branch information
Showing
12 changed files
with
190 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.