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

Validate output of functions against type #37430

Closed
w33ble opened this issue May 29, 2019 · 4 comments
Closed

Validate output of functions against type #37430

w33ble opened this issue May 29, 2019 · 4 comments
Labels
enhancement New value added to drive a business result Feature:Canvas impact:low Addressing this issue will have a low 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

@w33ble
Copy link
Contributor

w33ble commented May 29, 2019

Describe the feature:

Function definitions specify a type, which informs the interpreter about what type of data the function will produce. However, the output when calling a function is never validated against that type.

Canvas has type validation, which can be used in addition to a basic getType check, if we want to get fancy. But a simple getType(output) === fnSpec.type would suffice.

Describe a specific use case for the feature:

This is mostly so that when users create custom functions, they can be sure that they thing they return is valid, and will work with other functions that handle that type.

This is going to be an issue with some existing functions in Canvas though, specifically the filter function, as noted in #37422

@w33ble w33ble added enhancement New value added to drive a business result Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:small Small Level of Effort impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels May 29, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch

@lukeelmers
Copy link
Member

Hopefully the TS ExpressionFunction generic from #37438 helps with this too, as it will enforce the shape of the return value (of course, that's relying on the user to import and specify their types correctly, so certainly not bulletproof) :)

@exalate-issue-sync exalate-issue-sync bot added loe:medium Medium Level of Effort and removed loe:small Small Level of Effort labels Jun 21, 2021
@ppisljar
Copy link
Member

ppisljar commented Aug 9, 2022

Thank you for contributing to this issue, however, we are closing this issue due to inactivity as part of a backlog grooming effort. If you believe this feature/bug should still be considered, please reopen with a comment.

@ppisljar ppisljar closed this as not planned Won't fix, can't repro, duplicate, stale Aug 9, 2022
@exalate-issue-sync exalate-issue-sync bot added loe:small Small Level of Effort and removed loe:medium Medium Level of Effort labels Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Canvas impact:low Addressing this issue will have a low 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

5 participants