Skip to content
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

When timing metadata changes, ensure metadata.changed fires #7576

Merged
merged 4 commits into from Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/cells/src/widget.ts
Expand Up @@ -1083,7 +1083,10 @@ export namespace CodeCell {
if (!value) {
return;
}
const timingInfo: any = model.metadata.get('execution') || {};
const timingInfo: any = Object.assign(
{},
model.metadata.get('execution')
);
timingInfo[`iopub.${label}`] = value;
model.metadata.set('execution', timingInfo);
return true;
Expand All @@ -1096,7 +1099,10 @@ export namespace CodeCell {
model.executionCount = msg.content.execution_count;
const started = msg.metadata.started as string;
if (recordTiming && started) {
const timingInfo = (model.metadata.get('execution') as any) || {};
const timingInfo = Object.assign(
{},
model.metadata.get('execution') as any
);
if (started) {
timingInfo['shell.execute_reply.started'] = started;
}
Expand Down
1 change: 1 addition & 0 deletions packages/notebook/src/actions.tsx
Expand Up @@ -1056,6 +1056,7 @@ export namespace NotebookActions {
cell.outputs.clear();
(child as CodeCell).outputHidden = false;
cell.executionCount = null;
cell.metadata.delete('execution');
}
});
Private.handleState(notebook, state);
Expand Down