Skip to content

[Lens][ConfigBuilder] ES|QL dataview considered as external refs #239430

@nickofthyme

Description

@nickofthyme

Kibana version:

main

Describe the bug:

When creating a Lens visualization from via the LensConfigBuilder such as from the new Metrics Explorer in Discover (see below), we extract all the references from the dataviews not respecting which of these dataview are ad-hoc.

Image

ES|QL uses an ad-hoc dataview. In Lens the references is only external references to actual SOs, whereas internalReferences is used for temporary refs such as ad-hoc dataviews.

Expected behavior:

The LensConfigBuilder should correctly differentiate ad-hoc dataview references.

Screenshots (if relevant):

This can lead to an unnecessary error in the UI where it tries to find the ad-hoc dataview that does not actually exist.

Image

Any additional context:

Problematic code...

const references = buildReferences(dataviews);
return {
title: config.title,
visualizationType: 'lnsXY',
references,
state: {
datasourceStates,
internalReferences: [],
filters: [],
query: { language: 'kuery', query: '' },
visualization: buildVisualizationState(config),
// Getting the spec from a data view is a heavy operation, that's why the result is cached.
adHocDataViews: getAdhocDataviews(dataviews),
},

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 experienceimpact:mediumAddressing this issue will have a medium level of impact on the quality/strength of our product.loe:smallSmall Level of Effort

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions