wuqicyber opened a new issue, #37520:
URL: https://github.com/apache/superset/issues/37520

   ### Bug description
   
   ## Summary
   When using server-side pagination in a table chart and attempting to sort by 
a custom SQL expression column (adhoc column), the API returns a 400 error:     
    
   
   <img width="583" height="144" alt="Image" 
src="https://github.com/user-attachments/assets/4aa5e2c0-76e7-468c-9113-7474459670e5";
 />
                                                                                
                                             
                                                                                
                                                                                
                      
   This issue only occurs with server-side pagination enabled, where sorting is 
handled by the backend rather than the frontend.
   
   ## Steps to Reproduce
     1. Create a table chart with server-side pagination enabled                
                                                                                
                      
     2. Add a custom SQL expression column:
   
     <img width="736" height="497" alt="Image" 
src="https://github.com/user-attachments/assets/7a66c8c5-9d1e-462e-ae6e-c152c4fd2a75";
 />
     3. Click on the adhoc column header to sort by it                          
                                                                                
                      
     4. The API receives an orderby clause referencing the adhoc column by its 
label:                                                                          
                       
     {                                                                          
                                                                                
                      
       "orderby": [["new_rank_name", false]]                                    
                                                                                
                        
     }                                                                          
                                                                                
                      
     5. API returns 400 error  
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.10
   
   ### Node version
   
   18 or greater
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


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