villebro commented on code in PR #22945:
URL: https://github.com/apache/superset/pull/22945#discussion_r1094145403


##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/buildQuery.ts:
##########
@@ -67,11 +67,8 @@ export default function buildQuery(formData: QueryFormData) {
         fd,
         queryObject,
       )
-        ? timeComparePivotOperator(fd, queryObject)
-        : pivotOperator(fd, {
-            ...queryObject,
-            columns: fd.groupby,
-          });
+        ? timeComparePivotOperator(fd, baseQueryObject)
+        : pivotOperator(fd, baseQueryObject);

Review Comment:
   The problem with using `baseQueryObject` is that it's the query builder's 
best guess as to what a single query query context would look like. In other 
words it will apply the same value to both queries, despite the fact that they 
should be separate. For this reason, we need to stick to whatever we have in 
`queryObject`, as that should already be rendered with the correct options. For 
this reason I'd actually propose the following change, which seems to work in 
all my quick test cases (only time compare on query A, only time compare on 
query B, and time compare on both queries):
   ```suggestion
           ? timeComparePivotOperator(fd, {
               ...queryObject,
               columns: fd.groupby,
             })
           : pivotOperator(fd, {
               ...queryObject,
               columns: fd.groupby,
             });
   ```
   
   
![image](https://user-images.githubusercontent.com/33317356/216262164-0229d155-824d-4b19-873c-83b44c284e13.png)
   



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