Use local time for column/row headers and computed functions#1074
Use local time for column/row headers and computed functions#1074
Conversation
… paths print the current timezone and local time consistent with data
…date.h for proper date formatting
…roperly documented
|
Is it possible to have both behaviours implemented and be able to choose? |
Which behaviours are you referring to exactly? For the computed functions, even though it would be possible to preserve the old behaviour of UTC, it just isn't correct when compared with the underlying data: The issue is the same with row headers - we don't have an API for controlling their output from userland (they are generated in the C++ part of the codebase), and UTC output would be inconsistent with the underlying data. |
texodus
left a comment
There was a problem hiding this comment.
Thanks for the PR! This is a fantastic fix.
@andyferris With this change you can present datetime values in whatever timezone and format you choose, either via perspective-viewer-datagrid formatting, or the localized datetime from the perspective API. I think the important take away is that time-zone relativeness in encoding is now preserved, which is very important as perspective data on the server and client may be distributed across timezone. If you have any questions about this or have suggestions for how to improve this API, I encourage you to open a new Issue to describe it - we are very interested in feedback on this topic!


This PR fixes several issues with computed functions and computed columns in
perspective-python:hour_of_day,day_of_week, andmonth_of_yearfunctions now use local time to perform their calculations. Previously, all calculations were in UTC which could cause issues with datetimes that were on the cusp of one day/month to the next, as well as returning the wrong hour of day when compared with the input column.