databricks-sdk-py
databricks-sdk-py copied to clipboard
[FEATURE] Reduce Nullability
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.