codeant-ai-for-open-source[bot] commented on code in PR #44464:
URL: https://github.com/apache/superset/pull/44464#discussion_r4116057314
##########
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 `81a94cc`.
Added sort-by normalization that resolves saved metrics and Y-axis labels to
canonical names before validation, preserving the saved-metric status in
`SortByConfig`.
<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]