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


##########
superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.tsx:
##########
@@ -354,58 +425,59 @@ function AnnotationLayer({
 
   const fetchSliceData = useCallback((id: string | number): void => {
     const queryParams = rison.encode({
-      columns: ['query_context'],
+      columns: ['params', 'query_context'],
     });
     SupersetClient.get({
       endpoint: `/api/v1/chart/${id}?q=${queryParams}`,
-    }).then(({ json }) => {
-      const { result } = json;
-      const queryContext = result.query_context;
-      const formData = JSON.parse(queryContext).form_data;
-      const dataObject = {
-        data: {
-          ...formData,
-          groupby: formData.groupby?.map((column: QueryFormColumn) =>
-            getColumnLabel(column),
-          ),
-        },
-      };
-      setSlice(dataObject);
-    });
+    })
+      .then(({ json }) => {
+        const formData = getSliceFormData(json.result);

Review Comment:
   Agreed, done. Both paths now share the same `applySliceFormData` and 
`reportChartFailure` logic.
   
   You were right about the risk of them drifting — the two copies had already 
been modified independently once.
   



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