codeant-ai-for-open-source[bot] commented on code in PR #44464:
URL: https://github.com/apache/superset/pull/44464#discussion_r4115334811


##########
superset/mcp_service/chart/plugins/xy.py:
##########
@@ -103,6 +128,21 @@ def extract_column_refs(self, config: Any) -> 
list[ColumnRef]:
         if config.filters:
             for f in config.filters:
                 refs.append(ColumnRef(name=f.column))
+        if config.sort_by:
+            sort_entry = config.sort_by
+            if isinstance(sort_entry, list) and sort_entry:
+                sort_entry = sort_entry[0]
+            sort_col = (
+                sort_entry.column
+                if isinstance(sort_entry, SortByConfig)
+                else sort_entry
+                if isinstance(sort_entry, str)
+                else sort_entry.get("column")
+                if isinstance(sort_entry, dict)
+                else None
+            )
+            if sort_col:
+                refs.append(ColumnRef(name=sort_col))

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `bc6d9ff`.
   
   Added `_normalize_xy_sort_by`, which resolves each scalar or first list sort 
entry through `_update_sort_by_column` so saved metrics and canonical Y-axis 
names are normalized before validation.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



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