-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not treat empty path as a local path (#1717)
## Changes Fixes issue introduced here #1699 where PyPi packages were treated as local library. The reason is that `libraryPath` returns an empty string as a path for PyPi packages and then `IsLibraryLocal` treated empty string as local path. Both of these functions are fixed in this PR. ## Tests Added regression test
- Loading branch information
1 parent
84b4774
commit 783e05c
Showing
7 changed files
with
99 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
package libraries | ||
|
||
import "github.com/databricks/databricks-sdk-go/service/compute" | ||
import ( | ||
"fmt" | ||
|
||
func libraryPath(library *compute.Library) string { | ||
"github.com/databricks/databricks-sdk-go/service/compute" | ||
) | ||
|
||
func libraryPath(library *compute.Library) (string, error) { | ||
if library.Whl != "" { | ||
return library.Whl | ||
return library.Whl, nil | ||
} | ||
if library.Jar != "" { | ||
return library.Jar | ||
return library.Jar, nil | ||
} | ||
if library.Egg != "" { | ||
return library.Egg | ||
return library.Egg, nil | ||
} | ||
if library.Requirements != "" { | ||
return library.Requirements | ||
return library.Requirements, nil | ||
} | ||
return "" | ||
|
||
return "", fmt.Errorf("not supported library type") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters