Skip to content

Commit

Permalink
Update codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
judahrand committed Feb 26, 2024
1 parent 3a7c193 commit dcff82a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .codegen/changelog.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ Dependency updates:
{{- end -}}

{{- define "entity" -}}
{{- if not . }}any /* ERROR */
{{- else if .IsEmpty}}`any`
{{- if not . }}Any /* ERROR */
{{- else if .IsEmpty}}`Any`
{{- else if .PascalName}}`databricks.sdk.service.{{.Package.Name}}.{{.PascalName}}`
{{- else if .IsAny}}`any`
{{- else if .IsAny}}`Any`
{{- else if .IsString}}`str`
{{- else if .IsBool}}`bool`
{{- else if .IsInt64}}`int`
Expand Down
6 changes: 3 additions & 3 deletions .codegen/service.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class {{.PascalName}}{{if eq "List" .PascalName}}Request{{end}}:{{if .Descriptio
return body

@classmethod
def from_dict(cls, d: Dict[str, any]) -> {{.PascalName}}{{if eq "List" .PascalName}}Request{{end}}:
def from_dict(cls, d: Dict[str, Any]) -> {{.PascalName}}{{if eq "List" .PascalName}}Request{{end}}:
"""Deserializes the {{.PascalName}}{{if eq "List" .PascalName}}Request{{end}} from a dictionary."""
return cls({{range $i, $f := .Fields}}{{if $i}}, {{end}}{{template "safe-snake-name" $f}}={{template "from_dict_type" $f}}{{end}})
{{end}}
Expand Down Expand Up @@ -71,7 +71,7 @@ class {{.PascalName}}{{if eq "List" .PascalName}}Request{{end}}:{{if .Descriptio
{{- else}}self.{{template "safe-snake-name" .}}{{- end -}}
{{- end -}}
{{- define "type" -}}
{{- if not . }}any # ERROR: No Type
{{- if not . }}Any # ERROR: No Type
{{- else if .IsExternal }}{{.Package.Name}}.{{.PascalName}}
{{- else if .ArrayValue }}List[{{template "type" .ArrayValue}}]
{{- else if .MapValue }}Dict[str,{{template "type" .MapValue}}]
Expand All @@ -85,7 +85,7 @@ class {{.PascalName}}{{if eq "List" .PascalName}}Request{{end}}:{{if .Descriptio
{{- else if .IsFloat64}}float
{{- else if .IsInt}}int
{{- else if .IsByteStream}}BinaryIO
{{- else}}any /* MISSING TYPE */
{{- else}}Any /* MISSING TYPE */
{{- end -}}
{{- end -}}

Expand Down

0 comments on commit dcff82a

Please sign in to comment.