Conversation
| @dataclass | ||
| class InitScriptEventDetails: | ||
| cluster: Optional['List[InitScriptInfoAndExecutionDetails]'] = None | ||
| global_: Optional['List[InitScriptInfoAndExecutionDetails]'] = None |
There was a problem hiding this comment.
Here is the corrected rename of the global field to global_
|
|
||
| # deduplicate items that may have been added during iteration | ||
| seen = set() | ||
| query['startIndex'] = 0 |
There was a problem hiding this comment.
This is incorrect but will be fixed in https://github.com/databricks/databricks-sdk-py/pull/433/files (start index should be 1).
| @@ -188,10 +188,10 @@ class {{.Name}}API:{{if .Description}} | |||
| {{template "method-call" .}} | |||
|
|
|||
| {{if and .Wait (and (not .IsCrudRead) (not (eq .SnakeName "get_run"))) }} | |||
There was a problem hiding this comment.
Thanks for doing this, LGTM, I have one concern -- this might lead to confusion on when we use .SnakeName and when template "safe-snake-name" .. Should we use safe-snake-name everywhere?
Longer term, I think we will remove this once we will have spec linter and then it would be one time effort to rename these back to .SnakeName
There was a problem hiding this comment.
No, you only need to use template "safe-snake-name" . when generating a field or method name. There are places where we check whether the operation is get_run. In that case, it doesn't matter too much, since that is not a reserved keyword.
With this PR in place, there isn't a need for the linter anymore, since we'll safely rename fields that conflict with keywords.
There was a problem hiding this comment.
If we add .SnakeName where it doesn't work, in theory, it should never pass tests, as these names are never allowed for identifiers of any kind. The developer would then correct the template.
| @dataclass | ||
| class InitScriptEventDetails: | ||
| cluster: Optional['List[InitScriptInfoAndExecutionDetails]'] = None | ||
| global_: Optional['List[InitScriptInfoAndExecutionDetails]'] = None |
Changes
This PR updates the OpenAPI spec for the Python SDK to d136ad0541f036372601bad9a4382db06c3c912d. As part of this, we add some protection against fields or methods in our spec that conflict with reserved keywords in Python.
Tests
make testrun locallymake fmtapplied