You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "saghatelian (via GitHub)" <gi...@apache.org> on 2023/02/23 06:29:34 UTC

[GitHub] [superset] saghatelian opened a new issue, #23167: HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset

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

   In Dataset Settings there is an option called "HOURS OFFSET". 
   When you have only one time column, it's working as expected: it adds the corresponding number of hours to the time column while outputting it on the chart. However, when you have more than one temporal columns, the number of hours is logically expected to be added to all of them. Now it adds to only the one column that is selected as the "TIME COLUMN" in the chart.
   
   #### How to reproduce the bug
   
   1. Create a dataset with more than one temporal field (e.g. Creation and expiration dates, as in the screencast),
   2. Add "HOURS OFFSET" to the dataset settings (e.g. 4) and save the dataset,
   3. Choose a "TIME COLUMN" in the Time settings of the chart and click Update,
   4. Choose another "TIME COLUMN" and click Update
   
   ### Expected results
   X hours (set in "HOURS OFFSET") should be added to all temporal fields, regardless of the "TIME COLUMN" selected.
   
   ### Actual results
   X hours are added to only one column, the one that is selected as the "TIME COLUMN" in the chart.
   
   Note, that in the screencast, the "Expire Date" of the bottom row is actually equal to the "Agreement Creation Date" of the top row, but they are displayed with a 4-hour difference either way, because of the "HOURS OFFSET" option set.
   
   #### Screenshots
   https://user-images.githubusercontent.com/43491361/220833739-32950223-19ba-40e4-be12-d09804c40fde.mp4
   
      
   Note, that the "Expire Date" of the bottom row is actually equal to the "Agreement Creation Date" of the top row, but they are displayed with a 4-hour difference either way, because of the "HOURS OFFSET" option set.
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version: Version 110.0.5481.112 (Official Build) (64-bit)
   - superset version: `latest` (checked on `latest-dev` too)
   - any feature flags active:
   "DASHBOARD_CROSS_FILTERS": True,
   "ALERT_REPORTS": True,
   "ENABLE_TEMPLATE_PROCESSING": True,
   "ENABLE_TEMPLATE_REMOVE_FILTERS": True,
   "GENERIC_CHART_AXES": True
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   


-- 
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: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #23167:
URL: https://github.com/apache/superset/issues/23167#issuecomment-1977347486

   Is this still an issue in 3.x?


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] gfieremans commented on issue #23167: HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset

Posted by "gfieremans (via GitHub)" <gi...@apache.org>.
gfieremans commented on issue #23167:
URL: https://github.com/apache/superset/issues/23167#issuecomment-1605702723

   Happens for me as well.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #23167: HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset
URL: https://github.com/apache/superset/issues/23167


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #23167:
URL: https://github.com/apache/superset/issues/23167#issuecomment-2083154517

   I wonder if @villebro or @michael-s-molina or @john-bodley know more about how this is all wired up... at least to conjecture a bit more ;)


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset [superset]

Posted by "saghatelian (via GitHub)" <gi...@apache.org>.
saghatelian commented on issue #23167:
URL: https://github.com/apache/superset/issues/23167#issuecomment-2079522450

   Hi @rusackas 
   I'm testing the 4.0.0 version now, and yes, the bug is there. Actually, as there is no "TIME COLUMN" option in the chart, now the hour offset doesn't affect the table chart at all (at least I couldn't make it affect any of the datetime fields). The same bug is present in the dashboard view. As my original video was probably deleted, I just recorded another one, showing the bug on the 4.0.0 version.
   https://github.com/apache/superset/assets/43491361/af9bf69c-b12f-4dac-88d8-e13c28a1956b
   
   Thank you for your time and effort.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #23167:
URL: https://github.com/apache/superset/issues/23167#issuecomment-4042080544

   Great to hear that @nh28 and team are looking into this! To help orient your investigation: the hours offset is applied in the backend query generation in `superset/connectors/sqla/models.py` — look at how `dttm_col` and `offset` interact when building the time expression. The offset appears to only be applied to the column designated as the main datetime column (`main_dttm_col`) rather than all columns marked as temporal. A fix would likely need to ensure the offset is applied consistently to all temporal columns when they appear in a query. Looking forward to seeing a PR from you!


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #23167:
URL: https://github.com/apache/superset/issues/23167#issuecomment-2741851943

   Hey all... it's been upward of a year since this was touched. Is this still happening in 4.1.1 or 5.0.0rc1? Volunteers encouraged to provide either updated context or a PR/fix, before this gets closed as stale. Sounds potentially important though, so I hope someone can show it some love. 


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #23167:
URL: https://github.com/apache/superset/issues/23167#issuecomment-2083153170

   Thanks for the video... the link to the video works great. Maybe it's too big to be displayed on the thread or something ¯\\\_(ツ)_/¯ 
   
   Anwyay, that is a very interesting bug you found, and I'm _not_ sure what all needs to change for this.
   
   In the Dataset Editor, I see that the "hours offset" field says it will be applied to "the time column" and not "all temporal columns" - I would _guess_ this is in itself problem, applying to "Default datetime" in the dataset rather than all columns marked with "Is temporal".
   
   The filters _do_ tie in to a single column on charts (which is why you can't remove the last temporal filter when editing a chart), but I'm not sure how the "hours offset" is mapped into the query, and why it would be the filtered column instead of all temporal columns.
   
   For that matter, I'm also wondering if the time filter works as expected... does it filter based on the offset time or the base UTC time? Clearly I'm not an "hours offset" power user ;)


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #23167:
URL: https://github.com/apache/superset/issues/23167#issuecomment-3453172127

   @nh28 sorry I never replied here, but that sounds great, and I hope you're having good luck with the effort :D 


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset [superset]

Posted by "saghatelian (via GitHub)" <gi...@apache.org>.
saghatelian commented on issue #23167:
URL: https://github.com/apache/superset/issues/23167#issuecomment-2079981001

   Ok, now I see that the original video is there too :) . Somehow It wasn't displayed several hours ago as I was writing the reply.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset [superset]

Posted by "lyndsiWilliams (via GitHub)" <gi...@apache.org>.
lyndsiWilliams commented on issue #23167:
URL: https://github.com/apache/superset/issues/23167#issuecomment-2125693026

   Hi! We're also experiencing this issue on our instance of Superset. I don't have a solution, but I thought I could provide more information to hopefully help figure out what's causing this.
   
   In our example, the dataset has a -4 hour offset and we're using line charts with a time comparison of 1 day ago. The metric line uses a custom SQL query and the X-axis is the default temporal column on the dataset. You can see the original metric line ends at 16:00 but the "1 day ago" comparison line ends at 12:00.
   
   **A strange observation I noticed:** The original metric line has the correct -4 hours offset. The "1 day ago" comparison line seems to have an _additional_ -4 hours offset applied. It seems that the hours offset might be applied twice within this functionality somewhere.
   
   I hope this helps, happy to continue discussing if anyone has any ideas for a solution! 💡 
   
   https://github.com/apache/superset/assets/55605634/002ccc3e-2da0-4b6d-9c19-b5d362b67bcf


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset [superset]

Posted by "saghatelian (via GitHub)" <gi...@apache.org>.
saghatelian commented on issue #23167:
URL: https://github.com/apache/superset/issues/23167#issuecomment-2768287898

   Hi @rusackas 
   I can confirm that it's still happening in 4.1.1. I haven't tested 5.0.0 yet.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] HOURS OFFSET applies only to 1 time column, it should apply to all temporal columns in the dataset [superset]

Posted by "nh28 (via GitHub)" <gi...@apache.org>.
nh28 commented on issue #23167:
URL: https://github.com/apache/superset/issues/23167#issuecomment-3331388093

   Hi @rusackas @saghatelian 
   I was able to reproduce this bug on 5.0.0. As it looks like no progress has been made in a while, me and a group of others would like to attempt this issue over the next couple of weeks.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org