mirror of https://github.com/databricks/cli.git
Fixed marking libraries from DBFS as remote (#750)
## Changes Fixed marking libraries from DBFS as remote ## Tests Updated unit tests to catch the regression
This commit is contained in:
parent
e08f419ef6
commit
e64463ba47
|
@ -162,7 +162,7 @@ func TestTranslatePaths(t *testing.T) {
|
|||
MainClassName: "HelloWorldRemote",
|
||||
},
|
||||
Libraries: []compute.Library{
|
||||
{Jar: "dbfs:///bundle/dist/task_remote.jar"},
|
||||
{Jar: "dbfs:/bundle/dist/task_remote.jar"},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -243,7 +243,7 @@ func TestTranslatePaths(t *testing.T) {
|
|||
)
|
||||
assert.Equal(
|
||||
t,
|
||||
"dbfs:///bundle/dist/task_remote.jar",
|
||||
"dbfs:/bundle/dist/task_remote.jar",
|
||||
bundle.Config.Resources.Jobs["job"].Tasks[6].Libraries[0].Jar,
|
||||
)
|
||||
|
||||
|
|
|
@ -165,8 +165,8 @@ func isRemoteStorageScheme(path string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// If the path starts with scheme:// format, it's a correct remote storage scheme
|
||||
return strings.HasPrefix(path, url.Scheme+"://")
|
||||
// If the path starts with scheme:/ format, it's a correct remote storage scheme
|
||||
return strings.HasPrefix(path, url.Scheme+":/")
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ var testCases map[string]bool = map[string]bool{
|
|||
"file://path/to/package": true,
|
||||
"C:\\path\\to\\package": true,
|
||||
"dbfs://path/to/package": false,
|
||||
"dbfs:/path/to/package": false,
|
||||
"s3://path/to/package": false,
|
||||
"abfss://path/to/package": false,
|
||||
}
|
||||
|
|
|
@ -12,4 +12,4 @@ resources:
|
|||
package_name: "my_test_code"
|
||||
entry_point: "run"
|
||||
libraries:
|
||||
- whl: dbfs://path/to/dist/mywheel.whl
|
||||
- whl: dbfs:/path/to/dist/mywheel.whl
|
||||
|
|
Loading…
Reference in New Issue