add notebook wrapper for normal file jobs

This commit is contained in:
kartikgupta-db 2023-09-05 17:02:16 +02:00
parent 0f0900b081
commit f7c733a72b
No known key found for this signature in database
GPG Key ID: 6AD5FA11FACDEA39
2 changed files with 7 additions and 4 deletions

View File

@ -89,11 +89,14 @@ func (n *notebookTrampoline) GetTemplate(b *bundle.Bundle, task *jobs.Task) (str
lines := strings.Split(s, "\n")
if strings.HasPrefix(lines[0], "# Databricks notebook source") {
return getDbnbTemplate(strings.Join(lines[1:], "\n"))
return getDbnbTemplate(strings.Join(lines, "\n"))
}
//TODO return getPyTemplate(s), nil
return s, nil
return getPyTemplate(s), nil
}
func getPyTemplate(s string) string {
return pyTrampolineData
}
func getDbnbTemplate(s string) (string, error) {

View File

@ -3,7 +3,7 @@ import runpy
import sys
import os
python_file = {{.PythonFile}}
python_file = {{.SourceFile}}
project_root = {{.ProjectRoot}}
#remove databricks args from argv
sys.argv = sys.argv[1:]