Skip to content

Commit

Permalink
chore: notebook runtime use filesystem handle attached to spec
Browse files Browse the repository at this point in the history
  • Loading branch information
z3z1ma committed Jun 7, 2024
1 parent eb440d9 commit 11fddfb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
8 changes: 1 addition & 7 deletions src/cdf/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,7 @@ def notebook(
try:
return (
workspace.get_notebook_spec(notebook)
.bind(
lambda s: execute_notebook_specification(
s,
storage=workspace.project.filesystem.wrapped,
**json.loads(params),
)
)
.bind(lambda s: execute_notebook_specification(s, **json.loads(params)))
.unwrap()
)
finally:
Expand Down
3 changes: 1 addition & 2 deletions src/cdf/core/runtime/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import typing as t
from datetime import date, datetime

import fsspec
import papermill

import cdf.core.logger as logger
Expand All @@ -24,7 +23,6 @@

def execute_notebook_specification(
spec: NotebookSpecification,
storage: t.Optional[fsspec.AbstractFileSystem] = None,
**params: t.Any,
) -> M.Result["NotebookNode", Exception]:
"""Execute a notebook specification.
Expand Down Expand Up @@ -56,6 +54,7 @@ def execute_notebook_specification(
logger.info(
f"Successfully ran notebook {spec.path} with params {merged_params} rendered into {output}"
)
storage = spec.workspace.filesystem
if storage and spec.storage_path:
storage_path = spec.storage_path.format(
name=spec.name,
Expand Down

0 comments on commit 11fddfb

Please sign in to comment.