databricks-sdk-py icon indicating copy to clipboard operation
databricks-sdk-py copied to clipboard

[FEATURE] Reduce Nullability

Open MeinAccount opened this issue 10 months ago • 0 comments

Problem Statement The Python-API is very anoying to consume in a typed setting (pyright autocomplete in VSCode, mypy Typechecker in CI/CD Pipeline), as a lot of fields are Optional / Nullable.

For instance client.jobs.list() returns a Iterator[BaseJob]. But why is BaseJob.job_id specified as Optional[int]? Can we really list a job that doesn't have an ID? Will BaseJob.settings ever be None? Will JobSettings.name ever be None? Will JobSettings.tasks ever be None? My code ends up sprinkled with a lot of assert [...] is not None.

MeinAccount avatar May 14 '25 12:05 MeinAccount