Your best companion for upgrading to Unity Catalog. UCX will guide you, the Databricks customer, through the process of upgrading your account, groups, workspaces, jobs etc. to Unity Catalog.
Other
196
stars
70
forks
source link
Adjust type hints in credentials handling for Azure API client #1964
This PR is stacked on #1943; it is stacked to verify the type hinting changes via the CI environment.
The situation is:
The Databricks SDK has partially implemented type hints for the credentials handlers.
The CredentialsProvider is the fundamental type for a callable factory that can be used to obtain credentials.
The CredentialsStrategy is the type that can be used for a function that can be used to obtain a provider, given the Config.
The @credentials_strategy decorator is used to fuse the two:
It decorates a function that, given a Config, returns a CredentialsProvider.
The decorated function that it returns is a CredentialsStrategy.
The type upstream type hinting for the @credentials_strategy decorator is incomplete: the return type is omitted. This confuses IntelliJ/PyCharm a little but not Mypy.
Changes
This PR is stacked on #1943; it is stacked to verify the type hinting changes via the CI environment.
The situation is:
The Databricks SDK has partially implemented type hints for the credentials handlers.
The
CredentialsProvider
is the fundamental type for a callable factory that can be used to obtain credentials.The
CredentialsStrategy
is the type that can be used for a function that can be used to obtain a provider, given theConfig
.The
@credentials_strategy
decorator is used to fuse the two:Config
, returns aCredentialsProvider
.CredentialsStrategy
.The type upstream type hinting for the
@credentials_strategy
decorator is incomplete: the return type is omitted. This confuses IntelliJ/PyCharm a little but not Mypy.