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

Added timeout to w.clusters.ensure_cluster_running() #227

Merged
merged 7 commits into from
Aug 2, 2023

Conversation

judahrand
Copy link
Contributor

@judahrand judahrand commented Jul 10, 2023

Changes

This picks up where #118 left off.

Tests

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

nfx and others added 2 commits July 10, 2023 19:53
- Retry on `OperationFailed` errors, same as in Java SDK
@codecov-commenter
Copy link

codecov-commenter commented Jul 10, 2023

Codecov Report

Patch coverage: 48.27% and project coverage change: -0.02% ⚠️

Comparison is base (3213b7b) 53.73% compared to head (5c387f8) 53.72%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #227      +/-   ##
==========================================
- Coverage   53.73%   53.72%   -0.02%     
==========================================
  Files          33       33              
  Lines       19332    19349      +17     
==========================================
+ Hits        10389    10396       +7     
- Misses       8943     8953      +10     
Files Changed Coverage Δ
databricks/sdk/mixins/compute.py 34.22% <48.27%> (+0.89%) ⬆️

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

@@ -203,16 +209,25 @@ def select_node_type(self,
return nt.node_type_id
raise ValueError("cannot determine smallest node type")

def ensure_cluster_is_running(self, cluster_id: str):
def ensure_cluster_is_running(self, cluster_id: str) -> compute.ClusterDetails:
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you need cluster details to be returned? this will have to be adjusted across all SDKs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't have to 🤷‍♂️ Just seemed more useful given that we have it than returning None.

Do you want me to revert that commit?

Copy link
Contributor

Choose a reason for hiding this comment

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

For now, yes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@judahrand could you address this comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry! I'd forgotten to follow up on this. Done now.

This was requested in order to match up with the SDKs in
other languages.

This reverts commit 3f04d7c.
@nfx nfx changed the title Ensure cluster running Added timeout to w.clusters.ensure_cluster_running() Aug 2, 2023
@nfx nfx enabled auto-merge (squash) August 2, 2023 12:42
@nfx nfx disabled auto-merge August 2, 2023 13:14
@nfx nfx merged commit c1c0886 into databricks:main Aug 2, 2023
6 checks passed
@mgyucht mgyucht mentioned this pull request Aug 2, 2023
mgyucht added a commit that referenced this pull request Aug 2, 2023
* Added timeout to `w.clusters.ensure_cluster_running()` ([#227](#227)).
* Fixed `debug_headers` type hints for `WorkspaceClient` and `AccountClient` ([#258](#258)).
* Made dbutils typecast use a valid type variable ([#259](#259)).
mgyucht added a commit that referenced this pull request Aug 2, 2023
* Added timeout to `w.clusters.ensure_cluster_running()`
([#227](#227)).
* Fixed `debug_headers` type hints for `WorkspaceClient` and
`AccountClient`
([#258](#258)).
* Made dbutils typecast use a valid type variable
([#259](#259)).
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.

4 participants