uranusjr commented on a change in pull request #19723:
URL: https://github.com/apache/airflow/pull/19723#discussion_r755488516
##########
File path: airflow/providers/databricks/hooks/databricks.py
##########
@@ -419,6 +427,46 @@ def get_run_state(self, run_id: str) -> RunState:
state_message = state['state_message']
return RunState(life_cycle_state, result_state, state_message)
+ def get_run_state_str(self, run_id: str) -> str:
+ """
+ Return the string representation of RunState.
+
+ :param run_id: id of the run
+ :return: string describing run state
+ """
+ state = self.get_run_state(run_id)
+ run_state_str = (
+ f"State: {state.life_cycle_state}. Result: {state.result_state}.
{state.state_message}"
+ )
Review comment:
How about putting this in `RunState`’s `__str__` and just call
`str(state)` here?
--
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]