Skip to content

Commit 702416e

Browse files
committed
jupyter, cache - Respect JUPYTERCACHE environment variable
This variable is used to modified default cache in jupyter-cache https://jupyter-cache.readthedocs.io/en/latest/using/cli.html
1 parent 7ca42c0 commit 702416e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/resources/jupyter/notebook.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ def retrieve_nb_from_cache(nb, status, input, **kwargs):
122122
if not get_cache:
123123
raise ImportError('The jupyter-cache package is required for cached execution')
124124
trace('getting cache')
125-
nb_cache = get_cache(".jupyter_cache")
125+
# Respect env var used to modify default cache dir
126+
# https://jupyter-cache.readthedocs.io/en/latest/using/cli.html
127+
nb_cache = get_cache(os.getenv('JUPYTERCACHE', '.jupyter_cache'))
126128
if not cache == "refresh":
127129
cached_nb = nb_from_cache(nb, nb_cache)
128130
if cached_nb:

0 commit comments

Comments
 (0)