Skip to content

Commit 019d15e

Browse files
authored
Merge pull request #808 from Kaggle/papermill
pip install papermill
2 parents 816fffa + d481c26 commit 019d15e

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ RUN pip install flashtext && \
422422
pip install geopandas==0.6.3 && \
423423
pip install nnabla && \
424424
pip install vowpalwabbit && \
425+
# papermill can replace nbconvert for executing notebooks
426+
pip install papermill && \
425427
/tmp/clean-layer.sh
426428

427429
# Tesseract and some associated utility packages

tests/data/notebook.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
}
1212
],
1313
"metadata":{
14+
"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},
1415
"language_info":{
1516
"codemirror_mode":{
1617
"name":"ipython",
@@ -26,4 +27,4 @@
2627
},
2728
"nbformat":4,
2829
"nbformat_minor":4
29-
}
30+
}

tests/test_papermill.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import unittest
2+
3+
import subprocess
4+
5+
class TestPapermill(unittest.TestCase):
6+
def test_papermill(self):
7+
result = subprocess.run([
8+
'papermill',
9+
'/input/tests/data/notebook.ipynb',
10+
'-',
11+
], stdout=subprocess.PIPE)
12+
13+
self.assertEqual(0, result.returncode)
14+
self.assertTrue(b'999' in result.stdout)

0 commit comments

Comments
 (0)