-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] context formula functions don't update on dashboard #170762
Comments
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
The time range is built into the (data source) expression when the expression is created. In the editor, the expression is recreated from scratch every time the time range changes, leading to an updated value for However, in the embeddable, we only generate the expression once at load time. Because of this, the original time range value persists no matter what the user does. |
## Summary Fix #170762 https://github.com/elastic/kibana/assets/315764/f5b50ffa-4a03-45ee-bc7a-2f2aca7fa3bd ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kibana Machine <[email protected]>
## Summary Fix elastic#170762 https://github.com/elastic/kibana/assets/315764/f5b50ffa-4a03-45ee-bc7a-2f2aca7fa3bd ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kibana Machine <[email protected]> (cherry picked from commit 99763dc)
# Backport This will backport the following commits from `main` to `8.12`: - [[Lens] Fix context formula functions (#172710)](#172710) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Drew Tate","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-12-19T15:32:31Z","message":"[Lens] Fix context formula functions (#172710)\n\n## Summary\r\nFix https://github.com/elastic/kibana/issues/170762\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/315764/f5b50ffa-4a03-45ee-bc7a-2f2aca7fa3bd\r\n\r\n\r\n\r\n### Checklist\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"99763dc61647c817384019f6603de7ad258eea01","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:ExpressionLanguage","Team:Visualizations","Feature:Lens","backport:prev-minor","v8.13.0"],"number":172710,"url":"https://github.com/elastic/kibana/pull/172710","mergeCommit":{"message":"[Lens] Fix context formula functions (#172710)\n\n## Summary\r\nFix https://github.com/elastic/kibana/issues/170762\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/315764/f5b50ffa-4a03-45ee-bc7a-2f2aca7fa3bd\r\n\r\n\r\n\r\n### Checklist\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"99763dc61647c817384019f6603de7ad258eea01"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172710","number":172710,"mergeCommit":{"message":"[Lens] Fix context formula functions (#172710)\n\n## Summary\r\nFix https://github.com/elastic/kibana/issues/170762\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/315764/f5b50ffa-4a03-45ee-bc7a-2f2aca7fa3bd\r\n\r\n\r\n\r\n### Checklist\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"99763dc61647c817384019f6603de7ad258eea01"}}]}] BACKPORT-->
Kibana version:
8.11, maybe earlier
Describe the bug:
The result of the
time_range
,now
, andinterval
formula functions should be updated according to the current time range as well as the current moment in time.For example, when the time range is changed, so should the result of
time_range
. This works in Lens, but not in Dashboard (embeddable).Steps to reproduce:
time_range()
Screenshots (if relevant):
Screen.Recording.2023-11-07.at.8.46.00.AM.mov
The text was updated successfully, but these errors were encountered: