Skip to content

[Canvas] Bugs caused by using name instead of ID #100290

@wylieconlon

Description

@wylieconlon

The id property of a datatable indicates the JSON key in each row, while the name is only used for display. However, many of the Canvas expressions only use the name property for finding rows. For example, here is an expression function that generates two columns with the IDs col-0-a and col-1-b and the names bytes and Sum of bytes:

esaggs index={indexPatternLoad id="90943e30-9a47-11e8-b64d-95841ca0b247"} 
  aggs={aggHistogram id="a" enabled=true schema="segment" field="bytes" maxBars=34 interval="auto" has_extended_bounds=false min_doc_count=false extended_bounds="{\"min\":\"\",\"max\":\"\"}"}
  aggs={aggSum id="b" enabled=true schema="metric" field="bytes"} metricsAtAllLevels=false partialRows=false

The only function that works as expected:

  • | getCell column="col-1-b"

These functions are buggy:

  • | staticColumn name="Sum of bytes" value=5: Clears all the metadata from the second columns and inserts { 'Sum of bytes': 5 } into each row, instead of updating by name.

  • | columns include="col-0-a,col-1-b": Returns a totally empty table

  • | staticColumn name="col-1-b" value=5: Inserts a new column instead of replacing col-1-b

  • | alterColumn column="col-1-b" type="number" : Column not found

  • | alterColumn column="Sum of bytes" type="number" : Inserts { 'Sum of bytes': null } into each row, which is the wrong ID.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature:CanvasFeature:ExpressionLanguageInterpreter expression language (aka canvas pipeline)Team:PresentationPresentation Team for Dashboard, Input Controls, and Canvas t//bugFixes for quality problems that affect the customer experienceimpact:lowAddressing this issue will have a low level of impact on the quality/strength of our product.loe:mediumMedium Level of Effort

    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