Steps to reproduce (use the enclosed file to skip steps 1 & 2):
- Create a lens xy vis with simple date histogram and no splitAccessor defined.
- Export saved object from 7.6.
- Import saved object to master.
- Don't go to lens editor. Go straight to dashboard. Add the visualization (called simple_histogram_7_6) You'll see the following screen:

- Go to lens editor, save and come back to dashboard.
- The data is displayed correctly:

simple_histogram_76.ndjson.zip
Explanation of the problem:
A saved object of lnsXY contains expression that includes lens_xy_layer taking splitAccessor as one of the arguments. In version 7.6.1, if splitAccessor is not defined, the expression looks like below:
lens_xy_layer
{...}
splitAccessor=undefined
{...}
The proper behaviour would be not to include splitAccessor in this case at all and that's how versions 7.7 and later behave.
Before v7.8 the saved object was imported correctly despite splitAccessor=undefined and the redundant undefined value was not a problem. For 7.8 and 8.0 we've added a migration to change the structure of expression. The migration requires to decompose expression using fromExpression function coming from @kbn/interpreter/common. The function fromExpression uses grammar.parse function - it just converts undefined to string so in the effect we're getting splitAccessor="undefined" which causes not displaying visualization.
**The solution would be either
- to correct
grammar.parse function (we do it now for "true", "false" and "null" values, but the question is, maybe there's some behaviour built on this incorrect behaviour right now) or
- handle this exception in visualization, but then we'd have to drag with us this forever.**
Steps to reproduce (use the enclosed file to skip steps 1 & 2):
simple_histogram_76.ndjson.zip
Explanation of the problem:
A saved object of lnsXY contains expression that includes
lens_xy_layertakingsplitAccessoras one of the arguments. In version 7.6.1, ifsplitAccessoris not defined, the expression looks like below:The proper behaviour would be not to include
splitAccessorin this case at all and that's how versions 7.7 and later behave.Before v7.8 the saved object was imported correctly despite
splitAccessor=undefinedand the redundantundefinedvalue was not a problem. For 7.8 and 8.0 we've added a migration to change the structure of expression. The migration requires to decompose expression usingfromExpressionfunction coming from@kbn/interpreter/common. The functionfromExpressionusesgrammar.parsefunction - it just convertsundefinedto string so in the effect we're gettingsplitAccessor="undefined"which causes not displaying visualization.**The solution would be either
grammar.parsefunction (we do it now for "true", "false" and "null" values, but the question is, maybe there's some behaviour built on this incorrect behaviour right now) or