Skip to content

Commit

Permalink
fix: handle cell timeouts
Browse files Browse the repository at this point in the history
Signed-off-by: Panos Vagenas <[email protected]>
  • Loading branch information
vagenas committed Dec 14, 2023
1 parent d7b1a54 commit 5a1ffc5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nbrunner/nb_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
import deepsearch as ds
import nbformat
from deepsearch.cps.client.components.elastic import ElasticProjectDataCollectionSource
from nbconvert.preprocessors import CellExecutionError, ExecutePreprocessor
from nbconvert.preprocessors import (
CellExecutionError,
CellTimeoutError,
ExecutePreprocessor,
)
from rich.console import Console
from rich.style import Style
from rich.table import Table
Expand Down Expand Up @@ -55,7 +59,7 @@ def execute_notebook(self, run_id, notebook_path):
)
try:
out = ep.preprocess(nb, {"metadata": {"path": notebook_path.parent}})
except CellExecutionError as e:
except (CellExecutionError, CellTimeoutError) as e:
print(f"=> Error during {run_id}; check {output_filename} for details")
print(e.traceback)
out = None
Expand Down

0 comments on commit 5a1ffc5

Please sign in to comment.