-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Output ID passed in experimental_registerHtmlRenderingHook
is sometimes incorrect
#189488
Comments
fyi @mattbierner |
FYI @DonJayamanne, seems like downgrading Jupyter to |
Sorry, I haven't had a chance to look at this, will look at this tomorrow |
Looks like this is a duplicate of microsoft/vscode-jupyter#14161 The fault is either here or elsewhere spliceNotebookCellOutputs(splice: NotebookCellOutputsSplice): void {
//
} In this method we have code to dispose the previous outputs when
private _renderNow(splice: NotebookCellOutputsSplice, context: CellOutputUpdateContext) { |
The only reason it works in previous version of Jupyter is because the code in teh previous version was fractionally slower, Now things are much faster in Jupyter and both operations are happening together, but we seem to have hit an issue in existing code of VS Code. |
I can now confirm this is a duplicate of microsoft/vscode-jupyter#14161 |
Great, thanks for confirming! |
Not a duplicate of microsoft/vscode-jupyter#14161 |
@pwang347 I'm closing this issue as @rebornix mentioned that this is by design This explains why the post render is called again but with the same output item. The reason it used to work in older versions of Jupyter extension is because we'd first clear the output and then render the new output in two separate steps, as a result when the new item is added we need to create a whole new outputitem object. |
@DonJayamanne @rebornix I see - so in general, we should not expect that the rendered item's ID is up-to-date (whereas the one in the extension side will have a new ID). Would you have any recommendations on associating a particular output renderer to a cell? Would it be safe to cache the matching cell in the renderer assuming that on the first render both the renderer and the extension side will always have the same ID? Thanks! |
It's safe to cache the matching cell, the renderer won't get a render request from another cell on a re-render. |
Thinking some more, caching won't work because the cache will be broken whenever the output is actually re-rendered into something else (e.g. loading a different dataset). Unless we also check the content, which seems to be very over-engineered for just checking which cell the output originated from. Would it be safe to depend on the execution count in the output item metadata to figure out which cell the output came from at least as a temporary measure, and could we eventually have some other way to identify the cell in core? (Having it in core would also remove our dependency in #146831) |
@DonJayamanne @rebornix small ping on the above - thanks! |
yes |
Does this issue occur when all extensions are disabled?: Yes (requires Jupyter/Python)
Steps to Reproduce:
npm install
first)example.ipynb
file in the repoThe text was updated successfully, but these errors were encountered: