-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add execution start and end time metadata for code cells #29
base: main
Are you sure you want to change the base?
Add execution start and end time metadata for code cells #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 I think we would want to add a test, for example see:
async def test_post_execute(jp_fetch, pending_kernel_is_ready, snippet, output): |
since the exact timestamp will vary I would just check that the timing metadata is present and that the end time is greater than start time.
jupyter_server_nbmodel/handlers.py
Outdated
|
||
if metadata["record_timing"]: | ||
time_info = ycell["metadata"].get("execution",{}) | ||
time_info["start_time"] = datetime.now(timezone.utc).isoformat()[:-6] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the metadata I think we will want to match the exact identifiers as used on the frontend, so instead of start_time
we would use shell.execute_reply.started
and for end time - shell.execute_reply
- although these are less readable, it would make jupyter-server-nbmodel
a drop-in replacement and compatible with existing extensions like jupyterlab-execute-time
.
There also should be execution_failed
for when the execution fails.
For testing whether the metadata is being added correctly, we would need to pass Can we somehow create dummy ydoc and metadata and pass it instead or do we have some other better way to do this? |
You can change config to something like: "ServerApp": {
"jpserver_extensions": {
"jupyter_server_ydoc": True,
"jupyter_server_nbmodel": True,
"jupyter_server_fileid": True, # from jupyter_server_ydoc
},
"token": "", # not sure if needed
"disable_check_xsrf": True, # not sure if needed
}, in jupyter-server-nbmodel/conftest.py Lines 3 to 12 in ef8181c
to enable jupyter-server-nbmodel/jupyter_server_nbmodel/extension.py Lines 11 to 25 in ef8181c
You may also need to create a real collaborative notebook, for that purpose add
Is this the same as we are sending from frontend? If so you should be able to populate it with |
This CI error seems similar to the one described in the jupyterlab/jupyter-collaboration#252. |
I think these are warnings, so I would not be too worried. I would focus on fixing
|
References #22
Screenshots