@@ -36,39 +36,6 @@ import (
3636type phase string
3737
3838const (
39- // PythonMutatorPhaseLoad is the phase in which bundle configuration is loaded.
40- //
41- // At this stage, PyDABs adds statically defined resources to the bundle configuration.
42- // Which resources are added should be deterministic and not depend on the bundle configuration.
43- //
44- // We also open for possibility of appending other sections of bundle configuration,
45- // for example, adding new variables. However, this is not supported yet, and CLI rejects
46- // such changes.
47- //
48- // Deprecated, left for backward-compatibility with PyDABs.
49- PythonMutatorPhaseLoad phase = "load"
50-
51- // PythonMutatorPhaseInit is the phase after bundle configuration was loaded, and
52- // the list of statically declared resources is known.
53- //
54- // At this stage, PyDABs adds resources defined using generators, or mutates existing resources,
55- // including the ones defined using YAML.
56- //
57- // During this process, within generator and mutators, PyDABs can access:
58- // - selected deployment target
59- // - bundle variables values
60- // - variables provided through CLI arguments or environment variables
61- //
62- // The following is not available:
63- // - variables referencing other variables are in unresolved format
64- //
65- // PyDABs can output YAML containing references to variables, and CLI should resolve them.
66- //
67- // Existing resources can't be removed, and CLI rejects such changes.
68- //
69- // Deprecated, left for backward-compatibility with PyDABs.
70- PythonMutatorPhaseInit phase = "init"
71-
7239 // PythonMutatorPhaseLoadResources is the phase in which YAML configuration was loaded.
7340 //
7441 // At this stage, we execute Python code to load resources defined in Python.
@@ -150,24 +117,11 @@ func getOpts(b *bundle.Bundle, phase phase) (opts, error) {
150117 pydabsEnabled := ! reflect .DeepEqual (experimental .PyDABs , config.PyDABs {})
151118 pythonEnabled := ! reflect .DeepEqual (experimental .Python , config.Python {})
152119
153- if pydabsEnabled && pythonEnabled {
154- return opts {}, errors .New ("both experimental/pydabs and experimental/python are enabled, only one can be enabled" )
155- } else if pydabsEnabled {
156- if ! experimental .PyDABs .Enabled {
157- return opts {}, nil
158- }
120+ if pydabsEnabled {
121+ return opts {}, errors .New ("experimental/pydabs is deprecated, use experimental/python instead (https://docs.databricks.com/dev-tools/bundles/python)" )
122+ }
159123
160- // don't execute for phases for 'python' section
161- if phase == PythonMutatorPhaseInit || phase == PythonMutatorPhaseLoad {
162- return opts {
163- enabled : true ,
164- venvPath : experimental .PyDABs .VEnvPath ,
165- loadLocations : false , // not supported in PyDABs
166- }, nil
167- } else {
168- return opts {}, nil
169- }
170- } else if pythonEnabled {
124+ if pythonEnabled {
171125 // don't execute for phases for 'pydabs' section
172126 if phase == PythonMutatorPhaseLoadResources || phase == PythonMutatorPhaseApplyMutators {
173127 return opts {
@@ -258,14 +212,9 @@ func (m *pythonMutator) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagno
258212 return newRoot , nil
259213 })
260214
261- // don't instrument deprecated phases
262- if m .phase == PythonMutatorPhaseLoadResources || m .phase == PythonMutatorPhaseApplyMutators {
263- // we can precisely track resources that are added/updated, so sum doesn't double-count
264- b .Metrics .PythonUpdatedResourcesCount += int64 (result .UpdatedResources .Size ())
265- b .Metrics .PythonAddedResourcesCount += int64 (result .AddedResources .Size ())
266- } else {
267- mutateDiags = mutateDiags .Extend (diag .Warningf ("experimental/pydabs is deprecated and will be removed in future versions, use experimental/python instead" ))
268- }
215+ // we can precisely track resources that are added/updated, so sum doesn't double-count
216+ b .Metrics .PythonUpdatedResourcesCount += int64 (result .UpdatedResources .Size ())
217+ b .Metrics .PythonAddedResourcesCount += int64 (result .AddedResources .Size ())
269218
270219 if err == mutateDiagsHasError {
271220 if ! mutateDiags .HasError () {
0 commit comments