villebro opened a new pull request #14340:
URL: https://github.com/apache/superset/pull/14340


   ### SUMMARY
   Currently when sorting a filter box select by metric, the ordering isn't 
being applied in the query, making it possible for rows with to be missing the 
query if they fall below the default 1000 row limit.
   
   This was found while working on adding feature parity to the native select 
filter. While we're aiming to deprecate filter box soon, I wanted to make sure 
the results in the select filter are consistent with those returned by the 
select filter when reconciling results.
   
   ### SCREENSHOTS
   When ordering countries in descending order by population
   
![image](https://user-images.githubusercontent.com/33317356/116029311-b4c85b00-a661-11eb-97ff-048268ff73c1.png)
   Query:
   ```sql
   SELECT country_name AS country_name,
          sum("SP_POP_TOTL") AS "sum__SP_POP_TOTL"
   FROM wb_health_population
   GROUP BY country_name
   ORDER BY "sum__SP_POP_TOTL" DESC
   LIMIT 1000
   OFFSET 0
   ```
   
   ### SCREENSHOTS
   When ordering countries in descending order by population
   
![image](https://user-images.githubusercontent.com/33317356/116029535-3d46fb80-a662-11eb-8d90-02a492a3012a.png)
   Query:
   ```sql
   SELECT country_name AS country_name,
          sum("SP_POP_TOTL") AS "sum__SP_POP_TOTL"
   FROM wb_health_population
   GROUP BY country_name
   ORDER BY "sum__SP_POP_TOTL" ASC
   LIMIT 1000
   OFFSET 0
   ```
   
   When ordering 
   
   ### TEST PLAN
   <!--- What steps should be taken to verify the changes -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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

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