@@ -859,7 +859,9 @@ export class JupyterNotebookBase implements INotebook {
859
859
860
860
private generateRequest = (
861
861
code : string ,
862
- silent ?: boolean
862
+ silent ?: boolean ,
863
+ // tslint:disable-next-line: no-any
864
+ metadata ?: Record < string , any >
863
865
) : Kernel . IShellFuture < KernelMessage . IExecuteRequestMsg , KernelMessage . IExecuteReplyMsg > | undefined => {
864
866
//traceInfo(`Executing code in jupyter : ${code}`);
865
867
try {
@@ -873,7 +875,8 @@ export class JupyterNotebookBase implements INotebook {
873
875
allow_stdin : true , // Allow when silent too in case runStartupCommands asks for a password
874
876
store_history : ! silent // Silent actually means don't output anything. Store_history is what affects execution_count
875
877
} ,
876
- silent // Dispose only silent futures. Otherwise update_display_data doesn't finda future for a previous cell.
878
+ silent , // Dispose only silent futures. Otherwise update_display_data doesn't find a future for a previous cell.
879
+ metadata
877
880
)
878
881
: undefined ;
879
882
} catch ( exc ) {
@@ -1098,7 +1101,10 @@ export class JupyterNotebookBase implements INotebook {
1098
1101
subscriber . error ( this . sessionStartTime , exitError ) ;
1099
1102
subscriber . complete ( this . sessionStartTime ) ;
1100
1103
} else {
1101
- const request = this . generateRequest ( concatMultilineStringInput ( subscriber . cell . data . source ) , silent ) ;
1104
+ const request = this . generateRequest ( concatMultilineStringInput ( subscriber . cell . data . source ) , silent , {
1105
+ ...subscriber . cell . data . metadata ,
1106
+ ...{ cellId : subscriber . cell . id }
1107
+ } ) ;
1102
1108
1103
1109
// Transition to the busy stage
1104
1110
subscriber . cell . state = CellState . executing ;
0 commit comments