def get_job_by_id(self, job_id: str) -> SparkJob: if not self._use_job_service: return get_job_by_id(job_id, self) else: request = GetJobRequest(job_id=job_id) response = self._job_service.GetJob(request) return get_remote_job_from_proto(self._job_service, self._feast._extra_grpc_params, response.job)
def get_status(self) -> SparkJobStatus: response = self._service.GetJob(GetJobRequest(job_id=self._job_id), **self._grpc_extra_param_provider()) if response.job.status == JobStatus.JOB_STATUS_RUNNING: return SparkJobStatus.IN_PROGRESS elif response.job.status == JobStatus.JOB_STATUS_PENDING: return SparkJobStatus.STARTING elif response.job.status == JobStatus.JOB_STATUS_DONE: return SparkJobStatus.COMPLETED elif response.job.status == JobStatus.JOB_STATUS_ERROR: return SparkJobStatus.FAILED else: # we should never get here raise Exception(f"Invalid remote job state {response.job.status}")
def get_hash(self) -> str: response = self._service.GetJob(GetJobRequest(job_id=self._job_id), **self._grpc_extra_param_provider()) return response.job.hash
def get_error_message(self) -> str: job = self._service.GetJob(GetJobRequest(job_id=self._job_id), **self._grpc_extra_param_provider()).job return job.error_message