Seokyun-Ha commented on code in PR #34071:
URL: https://github.com/apache/airflow/pull/34071#discussion_r1316772594
##########
airflow/providers/databricks/hooks/databricks.py:
##########
@@ -388,6 +437,32 @@ def repair_run(self, json: dict) -> None:
"""
self._do_api_call(REPAIR_RUN_ENDPOINT, json)
+ def get_cluster_state(self, cluster_id: str) -> ClusterState:
+ """
+ Retrieves run state of the cluster.
+
+ :param cluster_id: id of the cluster
+ :return: state of the cluster
+ """
+ json = {"cluster_id": cluster_id}
+ response = self._do_api_call(GET_CLUSTER_ENDPOINT, json)
+ state = response["state"]
+ state_message = response["state_message"]
+ return ClusterState(state, state_message)
Review Comment:
Nope, because the `from_json()` method converts json string value to
`ClusterState` instance. Also,`response` is kind of python object type, so it
is not suitable to use.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]