-
Notifications
You must be signed in to change notification settings - Fork 121
[Python] Keep deprecated fields in Python code #3384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @@ -1,5 +1,12 @@ | |||
| package annotation | |||
|
|
|||
| type PythonKeepDeprecated string | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qq - is there a limitation in this schema that prevents use of boolean here? (I'm not familiar with this code, so just asking).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@denik for booleans, we will have to use a boolean pointer to have 3 states: nil (unset), false, and true. I think enums are cleaner for that.
df62309 to
a21573d
Compare
|
09649c4 to
2ad16b3
Compare
2ad16b3 to
20e1856
Compare
| """ | ||
| Remove fields that were deprecated during Private Preview. | ||
| """ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have examples of these?
They should rather be removed from the spec entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there are many of them. Should we remove them from the JSON schema altogether? For example, in jobs.TriggerSettings:
"table": {
"description": "Old table trigger settings name. Deprecated in favor of `table_update`.",
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TableUpdateTriggerConfiguration",
"x-databricks-preview": "PRIVATE",
"deprecationMessage": "This field is deprecated",
"doNotSuggest": true,
"deprecated": true
},
"table_update": {
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TableUpdateTriggerConfiguration",
"x-databricks-preview": "PRIVATE",
"doNotSuggest": true
}
I think following the principle, we should remove them from SDK v1
Changes
Python code generation doesn't remove deprecated fields anymore unless they were deprecated during Private Preview. A few fields are manually excluded because they have been deprecated for many years and have never functioned.
Remove
ForceNotDeprecatedannotation because it isn't needed anymore.Why
During updates, removing deprecated fields immediately can be surprising because there is no prior notice. There are also bundles that rely on the usage of deprecated fields.
Tests
By looking at diffs in the generated code