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

   ### Bug description
   
   When using Line Chart with Time Grain Hour, Superset generates a wrong 
chart. The issue is present in v6.0.0 and v6.1.0rc1 also, while versione 4.1.2 
works fine.
   
   Here the wrong chart with Time Grain = Hour
   
   <img width="1100" height="466" alt="Image" 
src="https://github.com/user-attachments/assets/e3992dc6-b04a-4e20-9ec0-72f9c5901fe9";
 />
   
   While here a correct chart with Time Grain = Day
   
   <img width="1103" height="474" alt="Image" 
src="https://github.com/user-attachments/assets/63277ab6-f18d-414b-b558-7d09c2db0643";
 />
   
   Probably the reason is the SQL query generated without the DATE() truncation:
   
   DATE_ADD(start_datetime, INTERVAL (HOUR(start_datetime)) HOUR) AS 
start_datetime, …
   GROUP BY DATE_ADD(start_datetime, INTERVAL (HOUR(start_datetime)) HOUR)
   
   It should be something like this:
   
   DATE_ADD(DATE(start_datetime), INTERVAL HOUR(start_datetime) HOUR) AS 
start_datetime, …
   GROUP BY DATE_ADD(DATE(start_datetime), INTERVAL HOUR(start_datetime) HOUR)
   
   Is there a fix for that, or a plan for a patch?
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   6.0.0
   
   ### Python version
   
   3.10
   
   ### Node version
   
   Not applicable
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [ ] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [ ] 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