Skip to content

Commit

Permalink
Fix integer deserialization for headers (#553)
Browse files Browse the repository at this point in the history
## Changes
Fix integer deserialization for headers. Headers are always serialized
as strings by Http convention, so we need to cast on deserialization.

## Tests
Used the new tests for files API
https://github.com/databricks/databricks-sdk-py/pull/552/files
  • Loading branch information
hectorcast-db authored Feb 21, 2024
1 parent f8e64b2 commit 0d3e9da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .codegen/service.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class {{.PascalName}}{{if eq "List" .PascalName}}Request{{end}}:{{if .Descriptio
{{- else}}d.get('{{.Name}}', None){{- end -}}
{{- else if (or .Entity.IsObject .Entity.IsExternal) }}_from_dict(d, '{{.Name}}', {{template "type-nq" .Entity}})
{{- else if .Entity.Enum }}_enum(d, '{{.Name}}', {{template "type-nq" .Entity}})
{{- else if and .IsHeader (or .Entity.IsInt64 .Entity.IsInt) }} int(d.get('{{.Name}}', None))
{{- else}}d.get('{{.Name}}', None){{- end -}}
{{- end -}}
{{- define "as_request_type" -}}
Expand Down
4 changes: 2 additions & 2 deletions databricks/sdk/service/files.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0d3e9da

Please sign in to comment.