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

Handle essql results with zero rows #28688

Closed
monfera opened this issue Jan 14, 2019 · 3 comments
Closed

Handle essql results with zero rows #28688

monfera opened this issue Jan 14, 2019 · 3 comments
Assignees
Labels
bug Fixes for quality problems that affect the customer experience enhancement New value added to drive a business result Feature:Canvas impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas

Comments

@monfera
Copy link
Contributor

monfera commented Jan 14, 2019

Kibana version:
6., 7.

Describe the bug:
Based on this item:

filters
| essql ...
| pointseries ...
| plot ...
| render

will, in case of zero selected tuples, yield ⚠️ rather than, in increasing level of preference, one of

  • a blank element
  • a warning message
  • a customizable error message
  • alternative contents, eg. markup or image
@monfera monfera added discuss triage_needed Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas labels Jan 14, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas

@w33ble w33ble self-assigned this Jan 29, 2019
@w33ble w33ble added bug Fixes for quality problems that affect the customer experience canvasGA_2 and removed discuss triage_needed labels Jan 29, 2019
@w33ble w33ble changed the title [Canvas] Handle essql results with zero rows Handle essql results with zero rows Jan 29, 2019
@cqliu1 cqliu1 added the loe:small Small Level of Effort label Mar 15, 2019
@w33ble w33ble removed their assignment May 29, 2019
@shaunmcgough shaunmcgough added the impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. label Aug 8, 2019
@clintandrewhall clintandrewhall added the enhancement New value added to drive a business result label Apr 5, 2021
@poffdeluxe
Copy link
Contributor

Testing this in master, when an essql query has no results, essql returns a datatable with columns and no rows. That seems correct to me.

In addition, with #90481 being merged, instead of the math function throwing on the empty datatable, math has an onError function that can be set to null or zero if an exception (like empty datatable) is encountered in the expression.

The math function throwing an empty datatable exception seems like the biggest issue here now but now there's a way to address with with onError so I'm not sure what we'll want to do to make this easier for our users

@poffdeluxe
Copy link
Contributor

@cqliu1 wrote this as a good workaround for situations where getCell might be throwing an exception due to no row:

filters
| essql query="SELECT * FROM \"kibana_sample_data_ecommerce\""
| shape "square" fill={
  switch case={case if={rowcount | eq 0} then="pink"} case={case if={getCell "failures" | compare "gte" "lte" to=20 to=50} then="#fca325"} case={case if={getCell "failures" | compare "gte" to=50} then="red"} case={case if={getCell "failures" | compare "lt" to=20} then="#2C6120"} case={case if={getCell "failures" | compare "eq" to=null} then="#2C6120"}
} border="rgba(255,255,255,0)" borderWidth=0 maintainAspect=false
| render

The rowcount as the first case will get evaluated first to avoid an error. Perhaps a solution to this whole problem would be to allow an onError flag for getCell like what the math function supports

@jsanz jsanz closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2023
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 enhancement New value added to drive a business result Feature:Canvas impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

No branches or pull requests

10 participants