def get_hook(self, context=None) -> QuboleHook: if hasattr(self, 'hook') and (self.hook is not None): return self.hook else: return QuboleCheckHook( context=context, results_parser_callable=self.results_parser_callable, **self.kwargs )
def get_hook(self) -> QuboleCheckHook: """ Reinitialising the hook, as some template fields might have changed This method overwrites the original QuboleOperator.get_hook() which returns a QuboleHook. """ return QuboleCheckHook( context=self._hook_context, results_parser_callable=self.results_parser_callable, **self.kwargs )
def handle_airflow_exception(airflow_exception, hook: QuboleCheckHook): """Qubole check handle Airflow exception""" cmd = hook.cmd if cmd is not None: if cmd.is_success(cmd.status): qubole_command_results = hook.get_query_results() qubole_command_id = cmd.id exception_message = ( f'\nQubole Command Id: {qubole_command_id}\nQubole Command Results:\n{qubole_command_results}' ) raise AirflowException(str(airflow_exception) + exception_message) raise AirflowException(str(airflow_exception))
def get_hook(self, context=None): if hasattr(self, 'hook') and (self.hook is not None): return self.hook else: return QuboleCheckHook(context=context, **self.kwargs)
def get_hook(self) -> QuboleCheckHook: """Reinitialising the hook, as some template fields might have changed""" return QuboleCheckHook( context=self._hook_context, results_parser_callable=self.results_parser_callable, **self.kwargs )