JupyterLab doesn't have an argument for metadata in the execute request
method either:

https://github.com/jupyterlab/jupyterlab/blob/dae1113a094761a66484e915a1b3b7e489d91ed2/packages/services/src/kernel/kernel.ts#L256

https://github.com/jupyterlab/jupyterlab/blob/dae1113a094761a66484e915a1b3b7e489d91ed2/packages/services/src/kernel/messages.ts#L525

Of course, you can construct the message yourself, like that function does:
https://github.com/jupyterlab/jupyterlab/blob/e161a8d536a7a370bea297f027d30800e6a6811f/packages/services/src/kernel/default.ts#L476

Jason



On Mon, Sep 25, 2017 at 2:57 AM MinRK <[email protected]> wrote:

> This is certainly *technically* possible because there is a metadata
> field in the messages. However, it may be tricky to pluck the metadata from
> the cell and add it to the request, given the current APIs.
>
> The cell submits the execution here
> <https://github.com/jupyter/notebook/blob/5.1.0/notebook/static/notebook/js/codecell.js#L343>
> and there’s no clear way to override that to add additional arguments.
> Similarly, kernel.execute
> <https://github.com/jupyter/notebook/blob/5.1.0/notebook/static/services/kernels/kernel.js#L726>
> doesn’t expose the metadata field as an argument.
>
> So I’d say that the ‘real’ fix is to:
>
>    1. expose metadata args in the kernel API (especially execute, but all
>    message-sending methods should support it)
>    2. allow passing metadata to execute somehow in the CodeCell API
>
> You might be able to work around the current state with some finagling,
> but it will probably be difficult to do it in a reliable way without some
> support from the API. Perhaps jupyterlab has better support for the
> metadata field that would make this easier.
>
> -Min
> ​
>
> On Sun, Sep 24, 2017 at 6:50 PM, Christopher Brooks <[email protected]>
> wrote:
>
>> Hi,
>>
>> We've created our own kernel wrapper which just calls the regular python
>> kernel but does some logging. I'd like to log some cell metadata as well,
>> but it doesn't look like this is being passed on the wire (at least, not
>> from my digging with the chrome dev tools). Is there a way to configure the
>> jupyter frontend to pass this metadata across to the kernel? If not
>> configure, suggestions on what methods we might need to overwrite in the
>> front end to achieve this? Could a client side extension handle this, or do
>> we have to do more significant surgery?
>>
>> Regards,
>>
>> Chris
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Project Jupyter" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jupyter/a8bb9619-7c9d-4c08-aa68-f5cd16a5f382%40googlegroups.com
>> <https://groups.google.com/d/msgid/jupyter/a8bb9619-7c9d-4c08-aa68-f5cd16a5f382%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/CAHNn8BVb6vhA7HqCXYwDx3pSH4ojqNLcMa4rEgV%2Bkof_F4FEVA%40mail.gmail.com
> <https://groups.google.com/d/msgid/jupyter/CAHNn8BVb6vhA7HqCXYwDx3pSH4ojqNLcMa4rEgV%2Bkof_F4FEVA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAPDWZHxArTO8vT9N-2JNrGkk%2BNMpcPa3mO-jOzvWXCX4Jitweg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to