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

   ### Bug description
   
   How to reproduce the bug
   1) In SQL lab, run a query similar to:
           CREATE TEMP TABLE temp_file_failures AS
           SELECT 
             DATE(timestamp) AS processing_date,
             COUNT(*) AS file_failures
           FROM file_audit
           WHERE audit_error != '' 
             AND successful_policies_no = 0 
             AND partner != ''
           GROUP BY DATE(timestamp);
           
           select * from temp_file_failures;
   
   2) Select "Save Dataset"
   3) Populate Dataset name
   4) Click "Save and Explorer"
   
   Expected results:  Dataset Saved and Chart Editor Launched
   
   Actual results: Fatal Error on Saving
   
   
![Image](https://github.com/user-attachments/assets/08398a5e-4d8b-466c-a72e-014b58bd3322)
   
   SELECT * FROM #temp
   Then save dataset(save and explore), add any columns to DIMENSIONS, click 
'CREATE CHART'
   
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   4.0.2
   
   ### Python version
   
   3.10
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   Modifying the query to the following allows the dataset to save correctly.  
   
   with temp_file_failures AS ( 
   SELECT 
     DATE(timestamp) AS processing_date,
     COUNT(*) AS file_failures
   FROM file_audit
   WHERE audit_error != '' 
     AND successful_policies_no = 0 
     AND partner != ''
   GROUP BY DATE(timestamp))
   
   select * from temp_file_failures;
   
   
   Banging my head to figure out why this isn't working (since a lot of our 
user base uses create temp table queries in SQL Lab.
   
   ### 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