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


##########
superset/charts/schemas.py:
##########
@@ -677,15 +677,28 @@ class 
ChartDataSortOptionsSchema(ChartDataPostProcessingOperationOptionsSchema):
     Sort operation config.
     """
 
-    columns = fields.Dict(
+    is_sort_index = fields.Boolean(
         metadata={
-            "description": "columns by by which to sort. The key specifies the 
column "
-            "name, value specifies if sorting in ascending order.",
-            "example": {"country": True, "gender": False},
+            "description": "Whether to sort by the index rather than by column 
values.",
+            "example": True,
+        },
+    )
+    by = fields.Raw(
+        # TODO: add correct union type once supported by Marshmallow
+        metadata={
+            "description": "Name, or list of names, of the columns to sort by. 
"
+            "Ignored when `is_sort_index` is set.",
+            "example": "country",
+        },
+    )
+    ascending = fields.Raw(
+        # TODO: add correct union type once supported by Marshmallow
+        metadata={
+            "description": "Sort ascending (the default) or descending. A list 
of "
+            "booleans may be given to set the direction per entry in `by`.",
+            "example": True,
         },

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not flag per-operation option fields as a complete validation fix when 
the enclosing options field remains an unvalidated dictionary; recommend 
validating post-processing options at the dispatch boundary instead.
   
   **Applied to:**
     - `superset/charts/schemas.py`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



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