@@ -211,8 +211,8 @@ async def get_cell_id_from_index(file_path: str, cell_index: int) -> str:
211211
212212async def add_cell (
213213 file_path : str ,
214- content : str | None = None ,
215- cell_id : str | None = None ,
214+ content : Optional [ str ] = None ,
215+ cell_id : Optional [ str ] = None ,
216216 add_above : bool = False ,
217217 cell_type : Literal ["code" , "markdown" , "raw" ] = "code" ,
218218):
@@ -295,8 +295,8 @@ async def add_cell(
295295
296296async def insert_cell (
297297 file_path : str ,
298- content : str | None = None ,
299- insert_index : int | None = None ,
298+ content : Optional [ str ] = None ,
299+ insert_index : Optional [ int ] = None ,
300300 cell_type : Literal ["code" , "markdown" , "raw" ] = "code" ,
301301):
302302 """Inserts a new cell to the Jupyter notebook at the specified cell index.
@@ -887,7 +887,7 @@ def read_cell_nbformat(file_path: str, cell_id: str) -> Dict[str, Any]:
887887 raise ValueError (f"Cell with { cell_id = } not found in notebook at { file_path = } " )
888888
889889
890- def _get_cell_index_from_id_json (notebook_json , cell_id : str ) -> int | None :
890+ def _get_cell_index_from_id_json (notebook_json , cell_id : str ) -> Optional [ int ] :
891891 """Get cell index from cell_id by notebook json dict.
892892
893893 Args:
@@ -905,7 +905,7 @@ def _get_cell_index_from_id_json(notebook_json, cell_id: str) -> int | None:
905905 return None
906906
907907
908- def _get_cell_index_from_id_ydoc (ydoc , cell_id : str ) -> int | None :
908+ def _get_cell_index_from_id_ydoc (ydoc , cell_id : str ) -> Optional [ int ] :
909909 """Get cell index from cell_id using YDoc interface.
910910
911911 Args:
@@ -924,7 +924,7 @@ def _get_cell_index_from_id_ydoc(ydoc, cell_id: str) -> int | None:
924924 return None
925925
926926
927- def _get_cell_index_from_id_nbformat (notebook , cell_id : str ) -> int | None :
927+ def _get_cell_index_from_id_nbformat (notebook , cell_id : str ) -> Optional [ int ] :
928928 """Get cell index from cell_id using nbformat interface.
929929
930930 Args:
0 commit comments