Skip to content
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

Create a deepcopy of config when creating workspace client from account client #542

Merged
merged 3 commits into from
Feb 12, 2024

Conversation

kartikgupta-db
Copy link
Contributor

@kartikgupta-db kartikgupta-db commented Feb 12, 2024

Changes

  • We are creating a shallow copy of the config object when creating a ws client from acc client. This leads to the config of acc client being overridden by changes made for the workspace client. This PR makes it so that we are making a deepcopy instead.
  • Also, correctly handle list response jsons in the API client.

Tests

  • added integration test
  • make test run locally
  • make fmt applied
  • relevant integration tests applied

@codecov-commenter
Copy link

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (a1055d1) 57.89% compared to head (914f32e) 57.92%.
Report is 2 commits behind head on main.

Files Patch % Lines
databricks/sdk/__init__.py 25.00% 3 Missing ⚠️
databricks/sdk/core.py 81.81% 2 Missing ⚠️
databricks/sdk/casing.py 95.83% 1 Missing ⚠️
databricks/sdk/config.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #542      +/-   ##
==========================================
+ Coverage   57.89%   57.92%   +0.03%     
==========================================
  Files          44       45       +1     
  Lines       27956    27990      +34     
==========================================
+ Hits        16185    16214      +29     
- Misses      11771    11776       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@edwardfeng-db edwardfeng-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kartikgupta-db kartikgupta-db added this pull request to the merge queue Feb 12, 2024
Merged via the queue into main with commit 9af2630 Feb 12, 2024
9 checks passed
@kartikgupta-db kartikgupta-db deleted the fix-ws-client-creation branch February 12, 2024 12:46
mgyucht added a commit that referenced this pull request Feb 15, 2024
This is a patch release with two small changes:

* Add `get_workspace_id()` to WorkspaceClient ([#537](#537)).

Bugfix:

* Create a deepcopy of config when creating workspace client from account client ([#542](#542)). This fixes an issue where `AccountClient` instances would stop working after calling `get_workspace_client()`.
mgyucht added a commit that referenced this pull request Feb 15, 2024
New features:

* Add `get_workspace_id()` to WorkspaceClient ([#537](#537)).

Bugfix:

* Create a deepcopy of config when creating workspace client from account client ([#542](#542)). This fixes an issue where `AccountClient` instances would stop working after calling `get_workspace_client()`.
@mgyucht mgyucht mentioned this pull request Feb 15, 2024
github-merge-queue bot pushed a commit that referenced this pull request Feb 15, 2024
New features:

* Add `get_workspace_id()` to WorkspaceClient
([#537](#537)).

Bugfix:

* Create a deepcopy of config when creating workspace client from
account client
([#542](#542)). This
fixes an issue where `AccountClient` instances would stop working after
calling `get_workspace_client()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants