File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,14 +70,18 @@ def retrieve_next_page(self, is_raw_output):
7070 page_rows = []
7171 logger .info ("retrieve_next_page: Calling next page" )
7272 json_response = self .client .paginated_api_call (can_raise_exeption = False )
73- metadata = self .client .get_metadata () if self .display_metadata else {DKUConstants .REPONSE_ERROR_KEY : None }
73+ metadata = self .client .get_metadata () if self .display_metadata else {
74+ DKUConstants .REPONSE_ERROR_KEY : json_response .get (DKUConstants .REPONSE_ERROR_KEY , None )
75+ }
7476 is_api_returning_dict = True
7577 if self .extraction_key :
7678 data_rows = get_value_from_path (json_response , self .extraction_key .split ("." ), can_raise = False )
7779 if data_rows is None :
7880 error_message = "Extraction key '{}' was not found in the incoming data" .format (self .extraction_key )
7981 if self .can_raise :
8082 raise DataikuException (error_message )
83+ elif DKUConstants .REPONSE_ERROR_KEY in metadata :
84+ return [metadata ]
8185 else :
8286 return self .format_page_rows ([{DKUConstants .REPONSE_ERROR_KEY : error_message }], is_raw_output , metadata )
8387 page_rows .extend (self .format_page_rows (data_rows , is_raw_output , metadata ))
You can’t perform that action at this time.
0 commit comments