File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88if __name__ == "__main__" :
99 github_workspace = os .getenv ("GITHUB_WORKSPACE" )
1010 workspace = f"{ github_workspace } /main"
11- # workspace = os.getenv("GITHUB_WORKSPACE")
1211 git_repo = os .getenv ("GITHUB_REPOSITORY" )
1312 git_ref = os .getenv ("GITHUB_REF" )
1413 commit_SHA = os .getenv ("GITHUB_SHA" )
Original file line number Diff line number Diff line change 77class NotebookExecutor :
88 def __init__ (self , workspace_path , notebook_path ):
99 self .workspace_path = workspace_path
10- # self.notebook_full_path = f"{workspace_path}/{notebook_path}"
11- self .notebook_full_path = notebook_path
10+ self .notebook_path = notebook_path
1211
1312 def run (self ):
14- if os .path .exists (self .notebook_full_path ):
15- print (f"Running notebook: { self .notebook_full_path } " )
16- nb = nbformat .read (open (self .notebook_full_path ), as_version = 4 )
13+ if os .path .exists (self .notebook_path ):
14+ print (f"Running notebook: { self .notebook_path } " )
15+ nb = nbformat .read (open (self .notebook_path ), as_version = 4 )
1716 ep = ExecutePreprocessor (kernel_name = "python3" , allow_errors = False )
1817 try :
1918 ep .preprocess (nb , {"metadata" : {"path" : self .workspace_path }})
@@ -22,5 +21,5 @@ def run(self):
2221 raise Exception (f"An error occurred while executing the notebook: { e } " )
2322 else :
2423 print (
25- f"Notebook file not found at path: { self .notebook_full_path } . Omitting notebook execution step."
24+ f"Notebook file not found at path: { self .notebook_path } . Omitting notebook execution step."
2625 )
You can’t perform that action at this time.
0 commit comments