Skip to content

[Lens] XY chart with no splitAccessor is not being displayed after migration from 7.6.1  #65677

@mbondyra

Description

@mbondyra

Steps to reproduce (use the enclosed file to skip steps 1 & 2):

  1. Create a lens xy vis with simple date histogram and no splitAccessor defined.
  2. Export saved object from 7.6.
  3. Import saved object to master.
  4. Don't go to lens editor. Go straight to dashboard. Add the visualization (called simple_histogram_7_6) You'll see the following screen:
    image
  5. Go to lens editor, save and come back to dashboard.
  6. The data is displayed correctly:
    image

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

  1. 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
  2. handle this exception in visualization, but then we'd have to drag with us this forever.**

Metadata

Metadata

Assignees

Labels

Feature:LensTeam:VisualizationsTeam label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t//bugFixes for quality problems that affect the customer experience

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions