@@ -37,10 +37,13 @@ def get_kernel_client(self, kernel_id) -> DocumentAwareKernelClient:
3737
3838 def get_yroom (self , path ) -> YRoom :
3939 """Get the yroom for a given path."""
40- file_id = self .file_id_manager .get_id (path )
41- yroom = self .yroom_manager .get_room (file_id )
42- return yroom
43-
40+ print ("DO WE SEE THIS?" )
41+ print (path )
42+ file_id = self .file_id_manager .index (path )
43+ room_id = f"json:notebook:{ file_id } "
44+ yroom = self .yroom_manager .get_room (room_id )
45+ return yroom
46+
4447 async def create_session (
4548 self ,
4649 path : Optional [str ] = None ,
@@ -53,27 +56,27 @@ async def create_session(
5356 After creating a session, connects the yroom to the kernel client.
5457 """
5558 output = await super ().create_session (
56- path ,
59+ path ,
5760 name ,
5861 type ,
59- kernel_name ,
62+ kernel_name ,
6063 kernel_id
6164 )
6265 if kernel_id is None :
6366 kernel_id = output ["kernel" ]["id" ]
6467
65-
6668 # NOTE: Question - is room_id equivalent to file ID?
6769 # Connect this session's yroom to the kernel.
68- yroom = self .get_yroom (path )
69- # TODO: we likely have a race condition here... need to
70- # think about it more. Currently, the kernel client gets
71- # created after the kernel starts fully. We need the
72- # kernel client instantiated _before_ trying to connect
73- # the yroom.
74- kernel_client = self .get_kernel_client (kernel_id )
75- await kernel_client .add_yroom (yroom )
76- self .log .info (f"Connected yroom { yroom .room_id } to kernel { kernel_id } . yroom: { yroom } " )
70+ if type == "notebook" :
71+ yroom = self .get_yroom (path )
72+ # TODO: we likely have a race condition here... need to
73+ # think about it more. Currently, the kernel client gets
74+ # created after the kernel starts fully. We need the
75+ # kernel client instantiated _before_ trying to connect
76+ # the yroom.
77+ kernel_client = self .get_kernel_client (kernel_id )
78+ await kernel_client .add_yroom (yroom )
79+ self .log .info (f"Connected yroom { yroom .room_id } to kernel { kernel_id } . yroom: { yroom } " )
7780 return output
7881
7982 async def delete_session (self , session_id ):
0 commit comments