Vitor-Avila opened a new pull request, #36247:
URL: https://github.com/apache/superset/pull/36247

   ### SUMMARY
   https://github.com/apache/superset/pull/35343 added support for including UI 
configs applied to an AG Grid table to exported CSVs. This logic was always 
including `metrics` in the payload (set to `[]` for un-aggregated charts). This 
would result in adding a `GROUP BY` in the query, which could be problematic 
for Snowflake (likely other DBs), in case columns used in sorting were not 
included in the `SELECT` statement.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   **Before**
   CSV download throws an error:
   ```
   {
     "message": "Error: 002024 (42601): 01c09e44-0001-1a32-0000-d8050006c466: 
SQL compilation error:\n[VIRTUAL_TABLE.C_ADDRESS] is not a valid order by 
expression"
   }
   ```
   
   **After**
   CSV download works properly.
   
   ### TESTING INSTRUCTIONS
   Test added. For manual testing:
   1. Create a Snowflake connection, using the `SNOWFLAKE_SAMPLES_DATA` 
database.
   2. Create a virtual dataset with below SQL query:
   ``` sql
   SELECT
     *,
     CONCAT(C_ADDRESS, ' | ', C_NATIONKEY) AS test_info
   FROM customer
   WHERE
     TRUE
   ```
   3. Create an un-aggregated AG Grid table with columns set to `C_COMMENT` and 
`TEST_INFO`. Use `C_ADDRESS [asc]` as the ordering config.
   4. Save this chart and add it to a dashboard.
   5. Trigger a chart CSV export for this chart from the dashboard.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] 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.

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