mirror of https://github.com/databricks/cli.git
Compare commits
No commits in common. "b6fcc1d1dbe97574e0b585346ced42dde076f980" and "2addd0c506f61b8c1eed98269931b4c9212d97b4" have entirely different histories.
b6fcc1d1db
...
2addd0c506
|
@ -430,7 +430,7 @@ func recommendCatalogSchemaUsage(b *bundle.Bundle, ctx context.Context, key stri
|
||||||
var fix string
|
var fix string
|
||||||
if t.NotebookTask != nil {
|
if t.NotebookTask != nil {
|
||||||
relPath = t.NotebookTask.NotebookPath
|
relPath = t.NotebookTask.NotebookPath
|
||||||
expected = `dbutils.widgets.text\(['"]schema|` +
|
expected = `" dbutils.widgets.text(['"]schema|` +
|
||||||
`USE[^)]+schema`
|
`USE[^)]+schema`
|
||||||
fix = " dbutils.widgets.text('catalog')\n" +
|
fix = " dbutils.widgets.text('catalog')\n" +
|
||||||
" dbutils.widgets.text('schema')\n" +
|
" dbutils.widgets.text('schema')\n" +
|
||||||
|
@ -462,11 +462,16 @@ func recommendCatalogSchemaUsage(b *bundle.Bundle, ctx context.Context, key stri
|
||||||
}
|
}
|
||||||
|
|
||||||
localPath, _, err := GetLocalPath(ctx, b, sourceDir, relPath)
|
localPath, _, err := GetLocalPath(ctx, b, sourceDir, relPath)
|
||||||
if err != nil || localPath == "" {
|
if err != nil {
|
||||||
// We ignore errors (they're reported by another mutator)
|
// Any path errors are reported by another mutator
|
||||||
// and ignore empty local paths (which means we'd have to download the file)
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if localPath == "" {
|
||||||
|
// If there is no local copy we don't want to download it and skip this check
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Warnf(ctx, "LocalPath: %s, relPath: %s, sourceDir: %s", localPath, relPath, sourceDir)
|
||||||
|
|
||||||
if !fileIncludesPattern(ctx, localPath, expected) {
|
if !fileIncludesPattern(ctx, localPath, expected) {
|
||||||
diags = diags.Extend(diag.Diagnostics{{
|
diags = diags.Extend(diag.Diagnostics{{
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
"default": "default",
|
"default": "default",
|
||||||
"pattern": "^\\w+$",
|
"pattern": "^\\w+$",
|
||||||
"pattern_match_failure_message": "Invalid schema name.",
|
"pattern_match_failure_message": "Invalid schema name.",
|
||||||
"description": "\nPlease provide a default schema during development.\ndefault_schema",
|
"description": "\nPlease provide an initial schema during development.\ndefault_schema",
|
||||||
"order": 5
|
"order": 5
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
"default": "default",
|
"default": "default",
|
||||||
"pattern": "^\\w+$",
|
"pattern": "^\\w+$",
|
||||||
"pattern_match_failure_message": "Invalid schema name.",
|
"pattern_match_failure_message": "Invalid schema name.",
|
||||||
"description": "\nPlease provide default schema during development.\ndefault_schema",
|
"description": "\nPlease provide an initial schema during development.\ndefault_schema",
|
||||||
"order": 7
|
"order": 7
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -33,9 +33,11 @@ targets:
|
||||||
host: {{workspace_host}}
|
host: {{workspace_host}}
|
||||||
# We explicitly specify /Workspace/Users/{{user_name}} to make sure we only have a single copy.
|
# We explicitly specify /Workspace/Users/{{user_name}} to make sure we only have a single copy.
|
||||||
root_path: /Workspace/Users/{{user_name}}/.bundle/${bundle.name}/${bundle.target}
|
root_path: /Workspace/Users/{{user_name}}/.bundle/${bundle.name}/${bundle.target}
|
||||||
permissions:
|
|
||||||
- {{if is_service_principal}}service_principal{{else}}user{{end}}_name: {{user_name}}
|
|
||||||
level: CAN_MANAGE
|
|
||||||
presets:
|
presets:
|
||||||
catalog: {{.default_catalog}}
|
catalog: {{.default_catalog}}
|
||||||
schema: {{$prod_schema}}
|
schema: {{$prod_schema}}
|
||||||
|
permissions:
|
||||||
|
- {{if is_service_principal}}service_principal{{else}}user{{end}}_name: {{user_name}}
|
||||||
|
level: CAN_MANAGE
|
||||||
|
run_as:
|
||||||
|
{{if is_service_principal}}service_principal{{else}}user{{end}}_name: {{user_name}}
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
"default": "default",
|
"default": "default",
|
||||||
"pattern": "^\\w+$",
|
"pattern": "^\\w+$",
|
||||||
"pattern_match_failure_message": "Invalid schema name.",
|
"pattern_match_failure_message": "Invalid schema name.",
|
||||||
"description": "\nPlease provide a default schema during development.\ndefault_schema",
|
"description": "\nPlease provide an initial schema during development.\ndefault_schema",
|
||||||
"order": 5
|
"order": 5
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue