Skip to content

Commit 36154de

Browse files
dualcchengcong1echarles
authored
feat:support gateway kernel client (#45)
* support gateway kernel client * Update jupyter_server_nbmodel/actions.py lint Co-authored-by: Eric Charles <[email protected]> * Update jupyter_server_nbmodel/actions.py lint Co-authored-by: Eric Charles <[email protected]> --------- Co-authored-by: chengcong1 <[email protected]> Co-authored-by: Eric Charles <[email protected]>
1 parent 03e22c0 commit 36154de

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jupyter_server_nbmodel/actions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def _stdin_hook(kernel_id: str, request_id: str, pending_input: PendingInput, ms
145145
f"Execution request {kernel_id} received a input request while waiting for an input.\n{msg}" # noqa: E501
146146
)
147147
header = msg["header"].copy()
148-
header["date"] = header["date"].isoformat()
148+
header["date"] = header["date"] if isinstance(header["date"], str) else header["date"].isoformat()
149149
pending_input.request_id = request_id
150150
pending_input.content = InputDescription(
151151
parent_header=header, input_request=InputRequest(**msg["content"])
@@ -269,6 +269,10 @@ async def kernel_worker(
269269
client.session.session = uid
270270
# FIXME
271271
# client.session.username = username
272+
from jupyter_server.gateway.managers import GatewayKernelClient
273+
if isinstance(client, GatewayKernelClient) and client.channel_socket is None:
274+
get_logger().debug(f"start channels {kernel_id}")
275+
await client.start_channels()
272276
results[uid] = await _execute_snippet(
273277
client, ydoc, snippet, metadata, partial(_stdin_hook, kernel_id, uid, pending_input)
274278
)

0 commit comments

Comments
 (0)