-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map date histogram values from 4.0 format to 4.1 format #4150
Conversation
deserialize: function (state, agg) { | ||
var interval = _.find(intervalOptions, {val: state}); | ||
return interval || _.find(intervalOptions, function (option) { | ||
// For upgrading from 4.0.x to 4.1.x - intervals are now stored as 'y' instead of 'year', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you scoot this left two-spaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops. Stupid IntelliJ.
@@ -71,8 +72,16 @@ define(function (require) { | |||
{ | |||
name: 'interval', | |||
type: 'optioned', | |||
deserialize: function (state, agg) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agg
isn't being used, it can be removed
This has a side effect of defaulting back to |
🈺 ship it ™️ 🈚 |
Map date histogram values from 4.0 format to 4.1 format
The format in which date histogram intervals are saved was changed in #3237. This caused issues with upgrading from 4.0 to 4.1, as the intervals would be lost and it would automatically revert to
auto
.This PR maps old values to the new values by comparing if the two are equal according to
moment.duration
:This works for all previous options:
second
,minute
,hour
,day
,week
,month
,year
.However, when a user goes to save a visualization, it will overwrite it with the new format (
s
,m
,h
,d
,w
,M
,y
).Closes #4149.