Comments (1)
Here's what I came up with to get around the situation:
def create_compute_cluster(db_client: WorkspaceClient, cluster_conf: dict) -> str:
cc = CreateCluster.from_dict(cluster_conf)
refactored_input = dict()
for field in list(cc.__dataclass_fields__.keys()):
refactored_input[field] = cc.__getattribute__(field)
return db_client.clusters.create_and_wait(**refactored_input, timeout=CLUSTER_UP_TIMEOUT)
I could also see the function reading the json file more like this:
def create_compute_cluster(db_client: WorkspaceClient, create_config_path: dict) -> str:
with open(create_config_path) as file:
create_config = json.load(file)
cc = CreateCluster.from_dict(create_config)
refactored_input = dict()
for field in list(cc.__dataclass_fields__.keys()):
refactored_input[field] = cc.__getattribute__(field)
return db_client.clusters.create_and_wait(**refactored_input, timeout=CLUSTER_UP_TIMEOUT)
What may make sense is some additional functions in ClustersAPI
class unless overloading is preferred using multipledispatch
. All this assumes there's a need outside my own to do this type of pattern. 🤷
from databricks-sdk-py.
Related Issues (20)
- [ISSUE] `catalog.ListConnectionsRequest` does not exist
- [ISSUE] Edge cases for cloud type detection
- [ISSUE] serving_endpoints.query raises BadRequest error when using azure-client-secret auth
- [ISSUE] Missing `CREATE_FOREIGN_SCHEMA` and `CREATE_FOREIGN_TABLE` privileges
- [ISSUE] "temporarily unavailable" errors are not retried
- [ISSUE] InvalidParameterValue: Path must be absolute: \mnt
- [ISSUE] Incorrectly set config.is_aws flag when host has trailing "/"
- [FEATURE] add serving_endpoints.create_or_update[_and_wait] functions HOT 3
- [ISSUE] w.dbutils.fs.ls fails when using databricks SDK inside another workspace HOT 1
- [FEATURE] Add totalResults to List() HOT 1
- [ISSUE] How to troubleshoot when a job creation failed HOT 1
- Using Azure App Registration with 'Mobile and desktop applications' fails refresh because of Origin header HOT 1
- [ISSUE] Inconsistent API design in ServingEndpointAccessControlRequest
- [ISSUE] Env Vars are not ignored when passing credentials directly
- ALERTS: Property "notify_on_ok" is missing from class databricks.sdk.service.sql.AlertOptions
- [ISSUE] Error with w.shares.share_permissions function / PermissionsList class not defined
- [ISSUE] list_network_connectivity_configurations always returns an empty array
- [ISSUE] Problems with dbt-databricks 1.6.4
- [ISSUE] WorkspaceClient.clusters.ensure_cluster_is_running - Timeout not configurable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from databricks-sdk-py.