Skip to content

[BUG] Installation._unmarshal initializes databricks.sdk.core.Config when the value is None  #169

@JCZuurmond

Description

@JCZuurmond

Description

The following code initiliatizes a databricks.sdk.core.Config when the value inst is None

if type_ref == databricks.sdk.core.Config:
if not inst:
inst = {}
return databricks.sdk.core.Config(**inst) # type: ignore[return-value]

This causes a bug in UCX when we load and save the WorkspaceConfig as that data classes has a databricks.sdk.core.Config attribute which is by default None and after loading it became databricks.sdk.core.Config(**{}). This field causes issues when it the config is used by our RuntimeContext which expects a different config than our cli context.

Reproduce

workspace_context: WorkspaceContext  # Created by the Databricks cli
config = workspace_context.installation.load(WorkspaceConfig)
workspace_context.installation.save(config)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions