Skip to content
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

[Lens] Throw error on array values in formulas #102249

Closed
wylieconlon opened this issue Jun 15, 2021 · 2 comments · Fixed by #102371
Closed

[Lens] Throw error on array values in formulas #102249

wylieconlon opened this issue Jun 15, 2021 · 2 comments · Fixed by #102371
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@wylieconlon
Copy link
Contributor

Formulas can't handle array valued data, specifically coming from last_value functions. The math function is not allowed to return array values, so formulas also cannot return array values. It should be treated as an error to evaluate a formula on an array value column.

Steps to reproduce:

  1. Use the ecommerce sample data
  2. Type the formula last_value(products.base_price)
  3. Get the error [lens_merge_tables] > [mapColumn] > [math] > Objects must have a type property

The error message here should be much more obviously caused by array valued fields.

Another option to consider in the long term is allowing the last_value function to take a reduce/concat function such as last_value(products.base_price, reduce='average')

@wylieconlon wylieconlon added bug Fixes for quality problems that affect the customer experience Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Jun 15, 2021
@wylieconlon wylieconlon self-assigned this Jun 15, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@wylieconlon wylieconlon changed the title [Lens] Throw erorr on array values in formulas [Lens] Throw error on array values in formulas Jun 15, 2021
@flash1293
Copy link
Contributor

+1 for short-term (7.14) improving the error message and long term providing a way to work around it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants