EnxDev commented on code in PR #37412:
URL: https://github.com/apache/superset/pull/37412#discussion_r4002971492


##########
superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx:
##########
@@ -105,11 +106,13 @@ export const useResultsPane = ({
         formData: cappedFormData,
         force: queryForce,
         resultFormat: 'json',
-        resultType: 'results',
+        resultType: 'full',
         ownState,
       })
         .then(({ json }) => {
-          setResultResp(ensureIsArray(json.result) as QueryResultInterface[]);
+          const responseArray = ensureIsArray<any>(json.result);
+          const transformedResponseArray = transformTableData(responseArray);
+          setResultResp(transformedResponseArray);
           setResponseError('');
           cache.set(cappedFormData, json.result);

Review Comment:
   Could we cache `transformedResponseArray` here (or run the transform when 
reading from the cache)? The network path puts transformed rows and column 
names into state, but this stores the raw `json.result`. A later cache hit at 
lines 93–96 passes that raw payload straight to `setResultResp`, so the verbose 
headers can disappear after returning to the same request. A test that 
exercises the fetch followed by a cache hit would keep the two paths aligned.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to