Description
If we look at this API: https://docs.databricks.com/api/workspace/clusters/edit
Then it could return quite few HTTP error codes: "This method might return the following HTTP codes: 400, 401, 403, 404, 500" (see attached screenshot)
But if we look at the actual implementation of the method at databricks-sdk python lib it looks rather sad at databricks/sdk/service/compute.py:
class ClustersAPI:
...
def edit(
...
op_response = self._api.do("POST", "/api/2.1/clusters/edit", body=body, headers=headers)
return Wait(self.wait_get_cluster_running, cluster_id=cluster_id)
please notice that op_response is completely ignored here and not passed to Wait object.
As the result we rely purely on:
def wait_get_cluster_running(
...
poll = self.get(cluster_id=cluster_id)
status = poll.state
status_message = poll.state_message
...
if status in failure_states:
msg = f"failed to reach RUNNING, got {status}: {status_message}"
raise OperationFailed(msg)
which might be less informative and give us the feedback only after timeout?
Hopefully this could be easily fixed on Databricks side?
Reproduction
wait_object = workspace.clusters.edit(**requested_spec)
assert wait_object.response is not None
Expected behavior
HTTP response from API endpoint correctly passed to wait_object
Is it a regression?
Did this work in a previous version of the SDK? If so, which versions did you try?
In a way it is.
In 0.60.0 it returns:
return Wait(
self.wait_get_cluster_running, response=EditClusterResponse.from_dict(op_response), cluster_id=cluster_id
)
In 0.77.0 it returns:
return Wait(self.wait_get_cluster_running, cluster_id=cluster_id)
Debug Logs
The SDK logs helpful debugging information when debug logging is enabled. Set the log level to debug by adding logging.basicConfig(level=logging.DEBUG) to your program, and include the logs here.
Other Information
- OS: macOS or Linux
- Version: 0.82.0
Additional context
Add any other context about the problem here.
Description
If we look at this API: https://docs.databricks.com/api/workspace/clusters/edit
Then it could return quite few HTTP error codes: "This method might return the following HTTP codes: 400, 401, 403, 404, 500" (see attached screenshot)
But if we look at the actual implementation of the method at databricks-sdk python lib it looks rather sad at
databricks/sdk/service/compute.py:please notice that
op_responseis completely ignored here and not passed toWaitobject.As the result we rely purely on:
which might be less informative and give us the feedback only after timeout?
Hopefully this could be easily fixed on Databricks side?
Reproduction
Expected behavior
HTTP response from API endpoint correctly passed to
wait_objectIs it a regression?
Did this work in a previous version of the SDK? If so, which versions did you try?
In a way it is.
In 0.60.0 it returns:
In 0.77.0 it returns:
Debug Logs
The SDK logs helpful debugging information when debug logging is enabled. Set the log level to debug by adding
logging.basicConfig(level=logging.DEBUG)to your program, and include the logs here.Other Information
Additional context
Add any other context about the problem here.