mirror of https://github.com/databricks/cli.git
fix: Replaced diag warning message with logger and removed unnecessary test
This commit is contained in:
parent
530a2a9bab
commit
aba35ae3fe
|
@ -8,6 +8,7 @@ import (
|
|||
"github.com/databricks/cli/bundle"
|
||||
"github.com/databricks/cli/bundle/config"
|
||||
"github.com/databricks/cli/bundle/libraries"
|
||||
"github.com/databricks/cli/libs/cmdio"
|
||||
"github.com/databricks/cli/libs/diag"
|
||||
"github.com/databricks/cli/libs/log"
|
||||
"github.com/databricks/databricks-sdk-go"
|
||||
|
@ -24,7 +25,7 @@ func WrapperWarning() bundle.Mutator {
|
|||
func (m *wrapperWarning) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnostics {
|
||||
if isPythonWheelWrapperOn(b) {
|
||||
if config.IsExplicitlyEnabled(b.Config.Presets.SourceLinkedDeployment) {
|
||||
return diag.Warningf("Python wheel notebook wrapper is not available when using source-linked deployment mode. You can disable this mode by setting 'presets.source_linked_deployment: false'")
|
||||
cmdio.LogString(ctx, "Python wheel notebook wrapper is not available when using source-linked deployment mode. You can disable this mode by setting 'presets.source_linked_deployment: false'")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -335,24 +335,6 @@ func TestNoWarningWhenPythonWheelWrapperIsOn(t *testing.T) {
|
|||
require.NoError(t, diags.Error())
|
||||
}
|
||||
|
||||
func TestPythonWheelWithSourceLinkedDeployment(t *testing.T) {
|
||||
enabled := true
|
||||
b := &bundle.Bundle{
|
||||
Config: config.Root{
|
||||
Experimental: &config.Experimental{
|
||||
PythonWheelWrapper: true,
|
||||
},
|
||||
Presets: config.Presets{
|
||||
SourceLinkedDeployment: &enabled,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
diags := bundle.Apply(context.Background(), b, WrapperWarning())
|
||||
require.NoError(t, diags.Error())
|
||||
require.Contains(t, diags[0].Summary, "Python wheel notebook wrapper is not available when using source-linked deployment mode")
|
||||
}
|
||||
|
||||
func TestSparkVersionLowerThanExpected(t *testing.T) {
|
||||
testCases := map[string]bool{
|
||||
"13.1.x-scala2.12": false,
|
||||
|
|
Loading…
Reference in New Issue