Skip to content

Commit 20e1856

Browse files
committed
Add all deprecated fields except private ones
1 parent 3948db9 commit 20e1856

File tree

18 files changed

+123
-29
lines changed

18 files changed

+123
-29
lines changed

.github/workflows/push.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ jobs:
180180
a.addKeyword('doNotSuggest');
181181
a.addKeyword('markdownDescription');
182182
a.addKeyword('x-databricks-preview');
183-
a.addKeyword('x-databricks-python-keep-deprecated');
184183
}" >> keywords.js
185184
186185
for file in ./bundle/internal/schema/testdata/pass/*.yml; do

bundle/docsgen/main.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ func assignAnnotation(s *jsonschema.Schema, a annotation.Descriptor) {
137137
s.Deprecated = true
138138
s.DeprecationMessage = a.DeprecationMessage
139139
}
140-
if a.ForceNotDeprecated {
141-
s.Deprecated = false
142-
s.DeprecationMessage = ""
143-
}
144140
if a.Preview == "PRIVATE" {
145141
s.DoNotSuggest = true
146142
s.Preview = a.Preview

bundle/internal/annotation/descriptor.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ type Descriptor struct {
99
MarkdownExamples string `json:"markdown_examples,omitempty"`
1010
DeprecationMessage string `json:"deprecation_message,omitempty"`
1111
Preview string `json:"x-databricks-preview,omitempty"`
12-
13-
// If true, takes priority over 'DeprecationMessage'
14-
ForceNotDeprecated bool `json:"force_not_deprecated,omitempty"`
1512
}
1613

1714
const Placeholder = "PLACEHOLDER"

bundle/internal/schema/annotations.go

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

141-
if a.ForceNotDeprecated {
142-
s.Deprecated = false
143-
s.DeprecationMessage = ""
144-
}
145-
146141
s.MarkdownDescription = convertLinksToAbsoluteUrl(a.MarkdownDescription)
147142
s.Title = a.Title
148143
s.Enum = a.Enum

bundle/internal/schema/annotations_openapi_overrides.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,6 @@ github.com/databricks/cli/bundle/config/resources.Pipeline:
353353
"run_as":
354354
"description": |-
355355
PLACEHOLDER
356-
"target":
357-
"force_not_deprecated": |-
358-
true
359356
"trigger":
360357
"deprecation_message": |-
361358
Use continuous instead

bundle/schema/jsonschema.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

experimental/python/codegen/codegen/jsonschema.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class Property:
1616
ref: str
1717
description: Optional[str] = None
1818
deprecated: Optional[bool] = None
19-
keep_deprecated: Optional[bool] = None
2019
stage: Optional[str] = None
2120

2221

@@ -102,7 +101,6 @@ def _parse_bool(value) -> Optional[bool]:
102101
ref=v["$ref"],
103102
description=v.get("description"),
104103
deprecated=_parse_bool(v.get("deprecated")),
105-
keep_deprecated=_parse_bool(v.get("x-databricks-python-keep-deprecated")),
106104
stage=v.get("x-databricks-preview"),
107105
)
108106

experimental/python/codegen/codegen/jsonschema_patch.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
# doesn't work, openapi schema needs to be updated to be enum
88
"kind",
99
},
10+
# fields that were deprecated a long time ago
11+
"resources.Pipeline": {
12+
# 'trigger' is deprecated, use 'continuous' or schedule pipeline refresh using job instead
13+
"trigger",
14+
},
15+
"pipelines.PipelineLibrary": [
16+
# 'whl' is deprecated, install libraries through notebooks and %pip command
17+
"whl",
18+
],
1019
}
1120

1221
EXTRA_REQUIRED_FIELDS: dict[str, list[str]] = {

experimental/python/codegen/codegen/main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,17 @@ def _transitively_mark_deprecated_and_private(
7777
def _remove_deprecated_fields(
7878
schemas: dict[str, openapi.Schema],
7979
) -> dict[str, openapi.Schema]:
80+
"""
81+
Remove fields that were deprecated during Private Preview.
82+
"""
83+
8084
new_schemas = {}
8185

8286
for name, schema in schemas.items():
8387
if schema.type == openapi.SchemaType.OBJECT:
8488
new_properties = {}
8589
for field_name, field in schema.properties.items():
86-
if field.deprecated and not field.keep_deprecated:
90+
if field.deprecated and field.stage == openapi.Stage.PRIVATE:
8791
continue
8892

8993
new_properties[field_name] = field
@@ -246,9 +250,6 @@ def _collect_reachable_schemas(
246250
if (
247251
not include_deprecated
248252
and field.deprecated
249-
# we don't remove keep_deprecated fields so they should be considered
250-
# reachable
251-
and not field.keep_deprecated
252253
):
253254
continue
254255

experimental/python/databricks/bundles/jobs/_models/gcp_attributes.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ class GcpAttributes:
5353
for the supported number of local SSDs for each instance type.
5454
"""
5555

56+
use_preemptible_executors: VariableOrOptional[bool] = None
57+
"""
58+
[DEPRECATED] This field determines whether the spark executors will be scheduled to run on preemptible
59+
VMs (when set to true) versus standard compute engine VMs (when set to false; default).
60+
Note: Soon to be deprecated, use the 'availability' field instead.
61+
"""
62+
5663
zone_id: VariableOrOptional[str] = None
5764
"""
5865
Identifier for the availability zone in which the cluster resides.
@@ -108,6 +115,13 @@ class GcpAttributesDict(TypedDict, total=False):
108115
for the supported number of local SSDs for each instance type.
109116
"""
110117

118+
use_preemptible_executors: VariableOrOptional[bool]
119+
"""
120+
[DEPRECATED] This field determines whether the spark executors will be scheduled to run on preemptible
121+
VMs (when set to true) versus standard compute engine VMs (when set to false; default).
122+
Note: Soon to be deprecated, use the 'availability' field instead.
123+
"""
124+
111125
zone_id: VariableOrOptional[str]
112126
"""
113127
Identifier for the availability zone in which the cluster resides.

0 commit comments

Comments
 (0)