feat(runtime): Implement streaming execution output (fixes #1813)#1814
feat(runtime): Implement streaming execution output (fixes #1813)#1814tinodj wants to merge 2 commits into
Conversation
…#1813) Problem: Previously, the output of commands executed via was only displayed after the entire process had finished. This provided a poor user experience for long-running commands, as there was no real-time feedback on the command's progress. Solution: This commit refactors the execution logic to handle output as a stream. An callback function has been introduced and is now passed to . This callback receives output in chunks during execution, tracks the current position in the stream via the new variable, and dispatches new output to the UI immediately. This provides users with real-time feedback from their commands.
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
|
Hi @tinodj — first, a genuine apology for the long silence here. This PR (and #1813) sat since early December without a proper review; the team was stretched thin and PRs didn't get the attention they deserved. That's on us. We now have more bandwidth to work through the backlog and invest in improvements, and I really appreciate your patience — and the fact that you filed a clear issue and took a run at fixing it. On the change itself: the intent is spot-on, but I don't think this approach can deliver streaming output, and I want to explain why so we can steer it toward something that does help. The limitation is in the execution API, not the client. This run path goes through the legacy You can see this in the SDK model too: the only output-shaping fields on A couple of smaller notes:
Good news — there's a way to get live output today: if you run the file via the Databricks Connect run/debug mode instead of "Upload and Run File", execution happens locally through Spark Connect and streams stdout to the integrated terminal in real time. That's the path we'd recommend for interactive, long-running scripts right now, and it's the one we're investing in making frictionless. Where I think we can still get value on this path — #1813 actually describes two problems, and the second one is fixable client-side:
Also worth noting: this is a duplicate of the older #1325, which reports the same thing — we'll consolidate those. |
Closes #1813.
Description
This pull request addresses the lack of real-time feedback during command execution in the
DatabricksRuntime.Problem
Previously, the output of executed commands was buffered and only displayed after the entire process had completed.
For long-running tasks, this left the user without any visibility into the command's progress, making it difficult t
determine if the process was still running or had stalled.
Solution
This PR refactors the execution logic to process output as a stream. This is achieved by:
onStatusUpdatecallback: This function is now passed to theexecutionContext.executemethod.
outputPositionvariable tracks the portion of the stream that has alreadybeen sent to the UI, ensuring that only new output is displayed.
This change provides users with immediate, real-time feedback from their running commands, significantly improving t
user experience.
Testing Notes
This feature has not yet been covered by automated tests. Manual verification is required.
To Test:
printstatements separated bytime.sleepcalls).
once at the end.