/api/sessions implements a deprecated model
futurist opened this issue · 2 comments
When called from MainKernelHandler.post
with below post data for end point /api/sessions
:
kernel: {"id": null, "name": "python3"}
name: ""
path: "test.ipynb"
type: "notebook"
The returned json:
{
"id": "982130c2-d1ad-4fe1-928f-46939323729c",
"kernel": {
"id": "bdba0b8f-942f-4b5c-82cb-4a356409b3fa",
"name": "python3",
"last_activity": "2018-09-24T02:47:30.362872Z",
"execution_state": "idle",
"connections": 0
},
"notebook": {
"path": "test.ipynb",
"name": ""
}
}
Which should be:
{
"id": "982130c2-d1ad-4fe1-928f-46939323729c",
"path": "test.ipynb",
"name": "",
"type": "notebook",
"kernel": {
"id": "bdba0b8f-942f-4b5c-82cb-4a356409b3fa",
"name": "python3",
"last_activity": "2018-09-24T02:47:30.362872Z",
"execution_state": "idle",
"connections": 0
},
"notebook": {
"path": "test.ipynb",
"name": ""
}
}
Problem The type, name, path
is losted, which is not a valid model for the result.
This seems also same problem for a GET /api/sessions
result.
How do you decide what is "a valid model"? Are there some client libraries that stopped working with our endpoints?
I don't see any lost data. The path and name are in the "notebook" section, and the presence of the "notebook" section indicates the type. But if newer versions of jupyter_client or other client-side libraries expect a different format, we should look into it.
The part of interface in the @jupyterlab/services
defined below:
Now it expect a model.path
etc. exists.
I'm try to create a PR in jupyterlab to fix the compatible with deprecated model format now.