-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make WorkspaceClient
and AccountClient
more friendly with autospeccing
#480
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We cannot `create_autospec(WorkspaceClient)`, because all public properties are created within the constructor. This PR makes it easier to introspect the class instances and make mocks more reliable. See: - https://docs.python.org/3/library/unittest.mock.html#autospeccing - https://stackoverflow.com/a/35921144/277035
nfx
changed the title
Make
(WIP) Make Dec 13, 2023
WorkspaceClient
and AccountClient
friendly with autospeccingWorkspaceClient
and AccountClient
friendly with autospeccing
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #480 +/- ##
==========================================
+ Coverage 57.72% 57.78% +0.05%
==========================================
Files 38 38
Lines 26162 26357 +195
==========================================
+ Hits 15103 15231 +128
- Misses 11059 11126 +67 ☔ View full report in Codecov by Sentry. |
nfx
changed the title
(WIP) Make
Make Dec 19, 2023
WorkspaceClient
and AccountClient
friendly with autospeccingWorkspaceClient
and AccountClient
friendly with autospeccing
nfx
changed the title
Make
Make Dec 19, 2023
WorkspaceClient
and AccountClient
friendly with autospeccingWorkspaceClient
and AccountClient
more friendly with autospeccing
hectorcast-db
approved these changes
Dec 20, 2023
kartikgupta-db
added a commit
that referenced
this pull request
Dec 20, 2023
* Sort imports in service template ([#479](#479)). * Add `py.typed` to support PEP-561 ([#483](#483)). * Fixed bug in `@retried` when exception subtypes were not respected ([#484](#484)). * Make `WorkspaceClient` and `AccountClient` more friendly with autospeccing ([#480](#480)). API Changes: * Added `azure_workspace_info` field for `databricks.sdk.service.provisioning.Workspace`. * Added `databricks.sdk.service.provisioning.AzureWorkspaceInfo` dataclass. * Changed `update_config()` method for [w.serving_endpoints](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/serving_endpoints.html) workspace-level service with new required argument order. * Changed `served_entities` field for `databricks.sdk.service.serving.EndpointCoreConfigInput` to no longer be required. * Changed `create()` method for [a.account_ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/account/account_ip_access_lists.html) account-level service with new required argument order. * Changed `replace()` method for [a.account_ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/account/account_ip_access_lists.html) account-level service with new required argument order. * Changed `update()` method for [a.account_ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/account/account_ip_access_lists.html) account-level service with new required argument order. * Changed `create()` method for [w.ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ip_access_lists.html) workspace-level service with new required argument order. * Changed `replace()` method for [w.ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ip_access_lists.html) workspace-level service with new required argument order. * Changed `update()` method for [w.ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ip_access_lists.html) workspace-level service with new required argument order. * Changed `ip_addresses` field for `databricks.sdk.service.settings.CreateIpAccessList` to no longer be required. * Changed `ip_addresses` field for `databricks.sdk.service.settings.ReplaceIpAccessList` to no longer be required. * Removed `list_id` field for `databricks.sdk.service.settings.ReplaceIpAccessList`. * Changed `enabled` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. * Changed `ip_addresses` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. * Changed `label` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. * Removed `list_id` field for `databricks.sdk.service.settings.UpdateIpAccessList`. * Changed `list_type` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. OpenAPI SHA: d3853c8dee5806d04da2ae8910f273ffb35719a5, Date: 2023-12-14
Merged
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 20, 2023
* Sort imports in service template ([#479](#479)). * Add `py.typed` to support PEP-561 ([#483](#483)). * Fixed bug in `@retried` when exception subtypes were not respected ([#484](#484)). * Make `WorkspaceClient` and `AccountClient` more friendly with autospeccing ([#480](#480)). API Changes: * Added `azure_workspace_info` field for `databricks.sdk.service.provisioning.Workspace`. * Added `databricks.sdk.service.provisioning.AzureWorkspaceInfo` dataclass. * Changed `update_config()` method for [w.serving_endpoints](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/serving_endpoints.html) workspace-level service with new required argument order. * Changed `served_entities` field for `databricks.sdk.service.serving.EndpointCoreConfigInput` to no longer be required. * Changed `create()` method for [a.account_ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/account/account_ip_access_lists.html) account-level service with new required argument order. * Changed `replace()` method for [a.account_ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/account/account_ip_access_lists.html) account-level service with new required argument order. * Changed `update()` method for [a.account_ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/account/account_ip_access_lists.html) account-level service with new required argument order. * Changed `create()` method for [w.ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ip_access_lists.html) workspace-level service with new required argument order. * Changed `replace()` method for [w.ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ip_access_lists.html) workspace-level service with new required argument order. * Changed `update()` method for [w.ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ip_access_lists.html) workspace-level service with new required argument order. * Changed `ip_addresses` field for `databricks.sdk.service.settings.CreateIpAccessList` to no longer be required. * Changed `ip_addresses` field for `databricks.sdk.service.settings.ReplaceIpAccessList` to no longer be required. * Removed `list_id` field for `databricks.sdk.service.settings.ReplaceIpAccessList`. * Changed `enabled` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. * Changed `ip_addresses` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. * Changed `label` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. * Removed `list_id` field for `databricks.sdk.service.settings.UpdateIpAccessList`. * Changed `list_type` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. OpenAPI SHA: d3853c8dee5806d04da2ae8910f273ffb35719a5, Date: 2023-12-14
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
We cannot
create_autospec(WorkspaceClient)
, because all public properties are created within the constructor:This PR makes it easier to introspect the class instances and makes mocks more reliable.
All existing behavior stays the same.
See:
Tests
make test
run locallymake fmt
applied