Skip to content

Commit

Permalink
Additional warning
Browse files Browse the repository at this point in the history
  • Loading branch information
schustmi committed Aug 6, 2024
1 parent 57c7eba commit a56abee
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/zenml/utils/notebook_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,14 @@ def extract_notebook_cell_code(notebook_path: str, cell_id: str) -> str:
cell["cell_type"],
)

# TODO: Should we exclude lines starting with special symbols here?
# Or would that mess with some code?
if any(line.startswith(("%", "!")) for line in cell["source"]):
logger.warning(
"Some lines in your notebook cell start with a `!` or `%` "
"character. Running a ZenML step remotely from a notebook "
"only works if the cell only contains python code. If any "
"of these lines contain Jupyter notebook magic commands, "
"remove them and try again."
)

return "".join(cell["source"])

Expand Down

0 comments on commit a56abee

Please sign in to comment.