Skip to content

Commit 3948db9

Browse files
committed
Revert
1 parent afedb6a commit 3948db9

File tree

6 files changed

+12
-84
lines changed

6 files changed

+12
-84
lines changed

bundle/docsgen/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func assignAnnotation(s *jsonschema.Schema, a annotation.Descriptor) {
137137
s.Deprecated = true
138138
s.DeprecationMessage = a.DeprecationMessage
139139
}
140-
if a.PythonKeepDeprecated == annotation.PythonKeepDeprecatedTrue {
140+
if a.ForceNotDeprecated {
141141
s.Deprecated = false
142142
s.DeprecationMessage = ""
143143
}
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
package annotation
22

3-
type PythonKeepDeprecated string
4-
5-
const (
6-
PythonKeepDeprecatedTrue PythonKeepDeprecated = "true"
7-
PythonKeepDeprecatedUnset PythonKeepDeprecated = ""
8-
)
9-
103
type Descriptor struct {
114
Description string `json:"description,omitempty"`
125
MarkdownDescription string `json:"markdown_description,omitempty"`
@@ -17,8 +10,8 @@ type Descriptor struct {
1710
DeprecationMessage string `json:"deprecation_message,omitempty"`
1811
Preview string `json:"x-databricks-preview,omitempty"`
1912

20-
// If true, keep the field in Python code even if it is deprecated.
21-
PythonKeepDeprecated PythonKeepDeprecated `json:"x-databricks-python-keep-deprecated,omitempty"`
13+
// If true, takes priority over 'DeprecationMessage'
14+
ForceNotDeprecated bool `json:"force_not_deprecated,omitempty"`
2215
}
2316

2417
const Placeholder = "PLACEHOLDER"

bundle/internal/schema/annotations.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ func assignAnnotation(s *jsonschema.Schema, a annotation.Descriptor) {
138138
s.Preview = a.Preview
139139
}
140140

141-
if a.PythonKeepDeprecated != annotation.PythonKeepDeprecatedUnset {
142-
s.PythonKeepDeprecated = a.PythonKeepDeprecated == annotation.PythonKeepDeprecatedTrue
141+
if a.ForceNotDeprecated {
142+
s.Deprecated = false
143+
s.DeprecationMessage = ""
143144
}
144145

145146
s.MarkdownDescription = convertLinksToAbsoluteUrl(a.MarkdownDescription)

bundle/internal/schema/annotations_openapi_overrides.yml

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ github.com/databricks/cli/bundle/config/resources.Job:
210210
```
211211
212212
For information about defining job tasks and overriding job settings, see [_](/dev-tools/bundles/job-task-types.md), [_](/dev-tools/bundles/job-task-override.md), and [_](/dev-tools/bundles/cluster-override.md).
213-
"format":
214-
"x-databricks-python-keep-deprecated": "false"
215213
"health":
216214
"description": |-
217215
PLACEHOLDER
@@ -313,8 +311,6 @@ github.com/databricks/cli/bundle/config/resources.ModelServingEndpoint:
313311
"permissions":
314312
"description": |-
315313
PLACEHOLDER
316-
"rate_limits":
317-
"x-databricks-python-keep-deprecated": "false"
318314
github.com/databricks/cli/bundle/config/resources.ModelServingEndpointPermissionLevel:
319315
"_":
320316
"enum":
@@ -358,11 +354,11 @@ github.com/databricks/cli/bundle/config/resources.Pipeline:
358354
"description": |-
359355
PLACEHOLDER
360356
"target":
361-
"x-databricks-python-keep-deprecated": "true"
357+
"force_not_deprecated": |-
358+
true
362359
"trigger":
363360
"deprecation_message": |-
364361
Use continuous instead
365-
"x-databricks-python-keep-deprecated": "false"
366362
github.com/databricks/cli/bundle/config/resources.PipelinePermissionLevel:
367363
"_":
368364
"enum":
@@ -714,26 +710,17 @@ github.com/databricks/databricks-sdk-go/service/compute.DockerImage:
714710
"description": |-
715711
PLACEHOLDER
716712
github.com/databricks/databricks-sdk-go/service/compute.Environment:
717-
"client":
718-
"x-databricks-python-keep-deprecated": "true"
719713
"dependencies":
720714
"description": |-
721715
List of pip dependencies, as supported by the version of pip in this environment.
722716
github.com/databricks/databricks-sdk-go/service/compute.GcpAttributes:
723717
"availability":
724718
"description": |-
725719
PLACEHOLDER
726-
"use_preemptible_executors":
727-
"x-databricks-python-keep-deprecated": "false"
728720
github.com/databricks/databricks-sdk-go/service/compute.InitScriptInfo:
729721
"abfss":
730722
"description": |-
731723
Contains the Azure Data Lake Storage destination path
732-
"dbfs":
733-
"x-databricks-python-keep-deprecated": "false"
734-
github.com/databricks/databricks-sdk-go/service/compute.Library:
735-
"egg":
736-
"x-databricks-python-keep-deprecated": "false"
737724
github.com/databricks/databricks-sdk-go/service/compute.LogAnalyticsInfo:
738725
"log_analytics_primary_key":
739726
"description": |-
@@ -756,9 +743,6 @@ github.com/databricks/databricks-sdk-go/service/jobs.GitSource:
756743
"git_snapshot":
757744
"description": |-
758745
PLACEHOLDER
759-
github.com/databricks/databricks-sdk-go/service/jobs.JobEmailNotifications:
760-
"no_alert_for_skipped_runs":
761-
"x-databricks-python-keep-deprecated": "false"
762746
github.com/databricks/databricks-sdk-go/service/jobs.JobEnvironment:
763747
"spec":
764748
"description": |-
@@ -778,11 +762,6 @@ github.com/databricks/databricks-sdk-go/service/jobs.RunJobTask:
778762
"python_named_params":
779763
"description": |-
780764
PLACEHOLDER
781-
github.com/databricks/databricks-sdk-go/service/jobs.SparkJarTask:
782-
"jar_uri":
783-
"x-databricks-python-keep-deprecated": "false"
784-
"run_as_repl":
785-
"x-databricks-python-keep-deprecated": "false"
786765
github.com/databricks/databricks-sdk-go/service/jobs.Subscription:
787766
"subscribers":
788767
"description": |-
@@ -804,9 +783,6 @@ github.com/databricks/databricks-sdk-go/service/jobs.Task:
804783
"health":
805784
"description": |-
806785
PLACEHOLDER
807-
github.com/databricks/databricks-sdk-go/service/jobs.TaskEmailNotifications:
808-
"no_alert_for_skipped_runs":
809-
"x-databricks-python-keep-deprecated": "false"
810786
github.com/databricks/databricks-sdk-go/service/jobs.TriggerSettings:
811787
"table_update":
812788
"description": |-
@@ -822,26 +798,17 @@ github.com/databricks/databricks-sdk-go/service/pipelines.CronTrigger:
822798
"timezone_id":
823799
"description": |-
824800
PLACEHOLDER
825-
github.com/databricks/databricks-sdk-go/service/pipelines.IngestionGatewayPipelineDefinition:
826-
"connection_id":
827-
"x-databricks-python-keep-deprecated": "false"
828801
github.com/databricks/databricks-sdk-go/service/pipelines.PipelineLibrary:
829802
"whl":
830803
"deprecation_message": |-
831804
This field is deprecated
832-
"x-databricks-python-keep-deprecated": "false"
833805
github.com/databricks/databricks-sdk-go/service/pipelines.PipelineTrigger:
834806
"cron":
835807
"description": |-
836808
PLACEHOLDER
837809
"manual":
838810
"description": |-
839811
PLACEHOLDER
840-
github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailParameters:
841-
"invalid_keywords":
842-
"x-databricks-python-keep-deprecated": "false"
843-
"valid_topics":
844-
"x-databricks-python-keep-deprecated": "false"
845812
github.com/databricks/databricks-sdk-go/service/serving.Route:
846813
"served_entity_name":
847814
"description": |-

bundle/internal/schema/parser.go

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,6 @@ func (p *openapiParser) extractAnnotations(typ reflect.Type, outputPath, overrid
196196
if description == "" {
197197
addEmptyOverride(k, basePath, overrides)
198198
}
199-
200-
// if field got deprecated outside of preview it can't be just removed and we keep it
201-
if refProp.Deprecated && refProp.Preview != "PRIVATE" {
202-
addPythonKeepDeprecatedOverride(k, basePath, overrides)
203-
}
204199
} else {
205200
addEmptyOverride(k, basePath, overrides)
206201
}
@@ -246,46 +241,22 @@ func prependCommentToFile(outputPath, comment string) error {
246241
return err
247242
}
248243

249-
// addPythonKeepDeprecatedOverride adds an override with "x-databricks-python-keep-deprecated: true" to
250-
// annotations_openapi_overrides.yaml unless it already specifies a value for "x-databricks-python-keep-deprecated".
251-
//
252-
// This way if field got deprecated, we add an override to keep it in Python code, until we revisit deprecation.
253-
func addPythonKeepDeprecatedOverride(key, pkg string, overridesFile annotation.File) {
254-
if overridesFile[pkg] == nil {
255-
overridesFile[pkg] = map[string]annotation.Descriptor{}
256-
}
257-
258-
overrides := overridesFile[pkg]
259-
260-
a, ok := overrides[key]
261-
if !ok {
262-
a = annotation.Descriptor{}
263-
}
264-
265-
// if we don't have explicit value, it means that field just got deprecated,
266-
// and we should keep it in Python code
267-
if a.PythonKeepDeprecated == annotation.PythonKeepDeprecatedUnset {
268-
a.PythonKeepDeprecated = annotation.PythonKeepDeprecatedTrue
269-
}
270-
271-
overrides[key] = a
272-
}
273-
274244
func addEmptyOverride(key, pkg string, overridesFile annotation.File) {
275245
if overridesFile[pkg] == nil {
276246
overridesFile[pkg] = map[string]annotation.Descriptor{}
277247
}
278248

279249
overrides := overridesFile[pkg]
250+
if overrides[key].Description == "" {
251+
overrides[key] = annotation.Descriptor{Description: annotation.Placeholder}
252+
}
280253

281254
a, ok := overrides[key]
282255
if !ok {
283256
a = annotation.Descriptor{}
284257
}
285-
286258
if a.Description == "" {
287259
a.Description = annotation.Placeholder
288260
}
289-
290261
overrides[key] = a
291262
}

bundle/schema/jsonschema.json

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)