Problem
Currently, when attempting to retrieve results or status for a non-existent query job, the API returns success instead of an error. This behavior is inconsistent with proper error handling practices.
Proposed Solution
Update the get_status method to return SearchJobNotFound error when the job does not exist. This should be done by adding a SQL query to check whether the job exists before attempting to retrieve its status.
Context
This issue was identified during the review of PR #1964, which added a cancel_search_job endpoint with proper SearchJobNotFound error handling. The same improvement should be applied to get_status and potentially other query job-related methods.
Related
Problem
Currently, when attempting to retrieve results or status for a non-existent query job, the API returns success instead of an error. This behavior is inconsistent with proper error handling practices.
Proposed Solution
Update the
get_statusmethod to returnSearchJobNotFounderror when the job does not exist. This should be done by adding a SQL query to check whether the job exists before attempting to retrieve its status.Context
This issue was identified during the review of PR #1964, which added a
cancel_search_jobendpoint with properSearchJobNotFounderror handling. The same improvement should be applied toget_statusand potentially other query job-related methods.Related
Cancellingas a terminal state when polling results. #1964Cancellingas a terminal state when polling results. #1964 (comment)