mirror of https://github.com/databricks/cli.git
add notebook wrapper for normal file jobs
This commit is contained in:
parent
0f0900b081
commit
f7c733a72b
|
@ -89,11 +89,14 @@ func (n *notebookTrampoline) GetTemplate(b *bundle.Bundle, task *jobs.Task) (str
|
||||||
|
|
||||||
lines := strings.Split(s, "\n")
|
lines := strings.Split(s, "\n")
|
||||||
if strings.HasPrefix(lines[0], "# Databricks notebook source") {
|
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 getPyTemplate(s), nil
|
||||||
return s, nil
|
}
|
||||||
|
|
||||||
|
func getPyTemplate(s string) string {
|
||||||
|
return pyTrampolineData
|
||||||
}
|
}
|
||||||
|
|
||||||
func getDbnbTemplate(s string) (string, error) {
|
func getDbnbTemplate(s string) (string, error) {
|
|
@ -3,7 +3,7 @@ import runpy
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
python_file = {{.PythonFile}}
|
python_file = {{.SourceFile}}
|
||||||
project_root = {{.ProjectRoot}}
|
project_root = {{.ProjectRoot}}
|
||||||
#remove databricks args from argv
|
#remove databricks args from argv
|
||||||
sys.argv = sys.argv[1:]
|
sys.argv = sys.argv[1:]
|
||||||
|
|
Loading…
Reference in New Issue