Skip to content

Commit e06b6dd

Browse files
author
amesar
committed
export_run.py: fix when exporting a run backed by a Git Repo
1 parent 8ce46e9 commit e06b6dd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mlflow_export_import/run/export_run.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ def export_run(self, run_id, output_dir):
8686
def _export_notebook(self, output_dir, notebook, tags, fs):
8787
notebook_dir = os.path.join(output_dir, "artifacts", "notebooks")
8888
fs.mkdirs(notebook_dir)
89-
revision_id = tags["mlflow.databricks.notebookRevisionID"]
89+
tag = "mlflow.databricks.notebookRevisionID"
90+
revision_id = tags.get(tag, None)
91+
if not revision_id:
92+
print("NOTE: Cannot download notebook '{notebook}' since tag '{tag}' does not exist. Notebook is probably a Git Repo notebook")
93+
return
9094
notebook_path = tags["mlflow.databricks.notebookPath"]
9195
notebook_name = os.path.basename(notebook_path)
9296
manifest = {

0 commit comments

Comments
 (0)