Copilot commented on code in PR #33275:
URL: https://github.com/apache/superset/pull/33275#discussion_r2253003839


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.js:
##########
@@ -274,15 +274,9 @@ const baseAggregatorTemplates = {
                   this.val !== null ? this.val : coercedValue,
                 );
               }
-            } else if (
-              mode === 'first' &&
-              this.sorter(x, this.val !== null ? this.val : x) <= 0
-            ) {
-              this.val = x;
-            } else if (
-              mode === 'last' &&
-              this.sorter(x, this.val !== null ? this.val : x) >= 0
-            ) {
+            } else if (mode === 'first') {
+              this.val = this.val === null ? x : this.val;

Review Comment:
   The 'first' mode logic is incorrect. It should capture the first value 
encountered, but this implementation will keep the first non-null value and 
ignore subsequent values even if the initial value was null. Consider using a 
separate flag to track if any value has been set: `if (this.val === null) { 
this.val = x; }`
   ```suggestion
                 if (!this.hasValue) {
                   this.val = x;
                   this.hasValue = true;
                 }
   ```



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