Skip to content

Commit e914a95

Browse files
committed
Fallback to default kernel if none specified.
We are being overly aggressive by raising an error if a kernel cannot be detected in a notebook. In an environment with only one kernel installed, the notebook executes just fine without errors, and we should not prematurely raise an error.
1 parent 8d8d155 commit e914a95

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

papermill/utils.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,9 @@ def nb_kernel_name(nb, name=None):
4040
Returns
4141
-------
4242
str
43-
The name of the kernel
44-
45-
Raises
46-
------
47-
ValueError
48-
If no kernel name is found or provided
43+
The name of the kernel or an empty string if none is found
4944
"""
50-
name = name or nb.metadata.get('kernelspec', {}).get('name')
51-
if not name:
52-
raise ValueError("No kernel name found in notebook and no override provided.")
53-
return name
45+
return name or nb.metadata.get('kernelspec', {}).get('name', '')
5446

5547

5648
def nb_language(nb, language=None):

0 commit comments

Comments
 (0)