MCPcopy Create free account
hub / github.com/databricks/run-notebook / importNotebookIfNeeded

Function importNotebookIfNeeded

packages/main/src/import-tmp-notebook.ts:56–72  ·  view source on GitHub ↗
(
  databricksHost: string,
  databricksToken: string,
  notebookPath: string,
  workspaceTmpDir: string
)

Source from the content-addressed store, hash-verified

54}
55
56export const importNotebookIfNeeded = async (
57 databricksHost: string,
58 databricksToken: string,
59 notebookPath: string,
60 workspaceTmpDir: string
61): Promise<{notebookPath: string; tmpNotebookDirectory?: string}> => {
62 if (isAbsolute(notebookPath) || isGitRefSpecified()) {
63 return {notebookPath}
64 }
65 const {tmpNotebookPath, tmpNotebookDirectory} = await importTmpNotebook(
66 databricksHost,
67 databricksToken,
68 notebookPath,
69 workspaceTmpDir
70 )
71 return {notebookPath: tmpNotebookPath, tmpNotebookDirectory}
72}

Callers 2

runHelperFunction · 0.90

Calls 2

isGitRefSpecifiedFunction · 0.90
importTmpNotebookFunction · 0.85

Tested by

no test coverage detected