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] sourceField can be set on math or formula columns breaking the editor #168561

Open
dej611 opened this issue Oct 11, 2023 · 5 comments
Open
Labels
bug Fixes for quality problems that affect the customer experience Feature:Lens impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@dej611
Copy link
Contributor

dej611 commented Oct 11, 2023

Describe the bug:

Just happened to see a couple of SOs who crashed the Lens editor on load and won't be visible on dashboard.
With missing dataView it is possible to see the editor start and report missing fields. As soon as the dataView is added then the visualization fails again.

Debugging the problem it came up that a single formula was setting the sourceField into math and formula columns, who should not have it. This produces a waterfall effect as that specific property is used to detect the type of column in the configuration, making the code take a different validation route rather than the correct one for those column types.

The quick fix is simple: just remove the sourceField from the math and formula columns and everything works. But this thing should not happen.

Still need to workout how this could have happened, other than manual changing the SO, and if our tests are missing something here.

Errors in browser console (if relevant):

Uncaught TypeError: _operations__WEBPACK_IMPORTED_MODULE_9__.operationDefinitionMap[column.operationType].getPossibleOperationForField is not a function
@dej611 dej611 added bug Fixes for quality problems that affect the customer experience Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Oct 11, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@stratoula
Copy link
Contributor

The impact here depends. If it is something that happens only if you change the SO manually then is low, otherwise is medium. I will set this to low for now but @dej611 if you find out that it can happen otherwise please update to medium.

@stratoula stratoula added the impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. label Oct 11, 2023
@louiselamvo
Copy link

Hey @stratoula , would you be able to please let us know in which future version release this might be fixed? One of our strategic telco customers in Australia advised that this is impacting many Users.
Please let me know if you need further details, thanks!

@stratoula
Copy link
Contributor

@louiselamvo can you give us more details on how you encounter this bug? We tried to reproduce it and we could not so we would appreciate any insights if you have. 🙏

@timductive timductive added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. and removed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Jan 25, 2024
@drewdaemon
Copy link
Contributor

drewdaemon commented Jan 25, 2024

Some technical specifics

  • SuggestionsPanel calls configurationsValid
  • configurationsValid calls formBasedDatasource.getUserMessages
  • formBasedDatasource.getUserMessages calls getUnsupportedOperationsWarningMessage
  • the formula column is not filtered out by this check because for some reason sourceField is present (set to ___records___ in the example I'm looking at)
  • an undefined getPossibleOperationForField method is invoked here

stratoula pushed a commit that referenced this issue Jan 26, 2024
## Summary

A stop-gap solution for #168561

This visualization can be used to test.

```
{"attributes":{"fieldFormatMap":"{\"hour_of_day\":{}}","name":"Kibana Sample Data Logs","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_logs"},"coreMigrationVersion":"8.8.0","created_at":"2024-01-24T19:57:34.193Z","id":"90943e30-9a47-11e8-b64d-95841ca0b247","managed":false,"references":[],"type":"index-pattern","typeMigrationVersion":"8.0.0","updated_at":"2024-01-24T19:57:34.193Z","version":"WzM1LDFd"}
{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"7945fa55-b9ea-4b10-a498-e265ef192d7d":{"columnOrder":["207508ea-7433-494f-9925-70d55831c74c","36d445ea-dd2a-4b13-96e2-d51d07d98f70","36d445ea-dd2a-4b13-96e2-d51d07d98f70X0"],"columns":{"207508ea-7433-494f-9925-70d55831c74c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"36d445ea-dd2a-4b13-96e2-d51d07d98f70":{"dataType":"number","isBucketed":false,"label":"median(bytes)","operationType":"formula","sourceField":"___records___","params":{"formula":"median(bytes)","isFormulaBroken":false},"references":["36d445ea-dd2a-4b13-96e2-d51d07d98f70X0"],"scale":"ratio"},"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of median(bytes)","operationType":"median","params":{"emptyAsNull":false},"scale":"ratio","sourceField":"bytes"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["36d445ea-dd2a-4b13-96e2-d51d07d98f70"],"layerId":"7945fa55-b9ea-4b10-a498-e265ef192d7d","layerType":"data","position":"top","seriesType":"bar_stacked","showGridlines":false,"xAccessor":"207508ea-7433-494f-9925-70d55831c74c"}],"legend":{"isVisible":true,"position":"right"},"preferredSeriesType":"bar_stacked","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide"}},"title":"Vis with formula","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-01-25T21:12:58.923Z","id":"2139b4e8-ee7c-41dc-9564-74b7c1e54216","managed":false,"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-7945fa55-b9ea-4b10-a498-e265ef192d7d","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-01-25T21:12:58.923Z","version":"WzgwLDFd"}
{"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":2,"missingRefCount":0,"missingReferences":[]}
```

### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Jan 26, 2024
…c#175644)

## Summary

A stop-gap solution for elastic#168561

This visualization can be used to test.

```
{"attributes":{"fieldFormatMap":"{\"hour_of_day\":{}}","name":"Kibana Sample Data Logs","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_logs"},"coreMigrationVersion":"8.8.0","created_at":"2024-01-24T19:57:34.193Z","id":"90943e30-9a47-11e8-b64d-95841ca0b247","managed":false,"references":[],"type":"index-pattern","typeMigrationVersion":"8.0.0","updated_at":"2024-01-24T19:57:34.193Z","version":"WzM1LDFd"}
{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"7945fa55-b9ea-4b10-a498-e265ef192d7d":{"columnOrder":["207508ea-7433-494f-9925-70d55831c74c","36d445ea-dd2a-4b13-96e2-d51d07d98f70","36d445ea-dd2a-4b13-96e2-d51d07d98f70X0"],"columns":{"207508ea-7433-494f-9925-70d55831c74c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"36d445ea-dd2a-4b13-96e2-d51d07d98f70":{"dataType":"number","isBucketed":false,"label":"median(bytes)","operationType":"formula","sourceField":"___records___","params":{"formula":"median(bytes)","isFormulaBroken":false},"references":["36d445ea-dd2a-4b13-96e2-d51d07d98f70X0"],"scale":"ratio"},"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of median(bytes)","operationType":"median","params":{"emptyAsNull":false},"scale":"ratio","sourceField":"bytes"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["36d445ea-dd2a-4b13-96e2-d51d07d98f70"],"layerId":"7945fa55-b9ea-4b10-a498-e265ef192d7d","layerType":"data","position":"top","seriesType":"bar_stacked","showGridlines":false,"xAccessor":"207508ea-7433-494f-9925-70d55831c74c"}],"legend":{"isVisible":true,"position":"right"},"preferredSeriesType":"bar_stacked","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide"}},"title":"Vis with formula","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-01-25T21:12:58.923Z","id":"2139b4e8-ee7c-41dc-9564-74b7c1e54216","managed":false,"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-7945fa55-b9ea-4b10-a498-e265ef192d7d","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-01-25T21:12:58.923Z","version":"WzgwLDFd"}
{"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":2,"missingRefCount":0,"missingReferences":[]}
```

### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

(cherry picked from commit 0dfff4c)
kibanamachine referenced this issue Jan 26, 2024
…175644) (#175658)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[Lens] stop gap solution for invalid formula and math columns
(#175644)](#175644)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Drew
Tate","email":"drew.tate@elastic.co"},"sourceCommit":{"committedDate":"2024-01-26T06:09:57Z","message":"[Lens]
stop gap solution for invalid formula and math columns (#175644)\n\n##
Summary\r\n\r\nA stop-gap solution for
https://github.com/elastic/kibana/issues/168561\r\n\r\nThis
visualization can be used to
test.\r\n\r\n```\r\n{\"attributes\":{\"fieldFormatMap\":\"{\\\"hour_of_day\\\":{}}\",\"name\":\"Kibana
Sample Data
Logs\",\"runtimeFieldMap\":\"{\\\"hour_of_day\\\":{\\\"type\\\":\\\"long\\\",\\\"script\\\":{\\\"source\\\":\\\"emit(doc['timestamp'].value.getHour());\\\"}}}\",\"timeFieldName\":\"timestamp\",\"title\":\"kibana_sample_data_logs\"},\"coreMigrationVersion\":\"8.8.0\",\"created_at\":\"2024-01-24T19:57:34.193Z\",\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"managed\":false,\"references\":[],\"type\":\"index-pattern\",\"typeMigrationVersion\":\"8.0.0\",\"updated_at\":\"2024-01-24T19:57:34.193Z\",\"version\":\"WzM1LDFd\"}\r\n{\"attributes\":{\"description\":\"\",\"state\":{\"adHocDataViews\":{},\"datasourceStates\":{\"formBased\":{\"layers\":{\"7945fa55-b9ea-4b10-a498-e265ef192d7d\":{\"columnOrder\":[\"207508ea-7433-494f-9925-70d55831c74c\",\"36d445ea-dd2a-4b13-96e2-d51d07d98f70\",\"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0\"],\"columns\":{\"207508ea-7433-494f-9925-70d55831c74c\":{\"dataType\":\"date\",\"isBucketed\":true,\"label\":\"timestamp\",\"operationType\":\"date_histogram\",\"params\":{\"dropPartials\":false,\"includeEmptyRows\":true,\"interval\":\"auto\"},\"scale\":\"interval\",\"sourceField\":\"timestamp\"},\"36d445ea-dd2a-4b13-96e2-d51d07d98f70\":{\"dataType\":\"number\",\"isBucketed\":false,\"label\":\"median(bytes)\",\"operationType\":\"formula\",\"sourceField\":\"___records___\",\"params\":{\"formula\":\"median(bytes)\",\"isFormulaBroken\":false},\"references\":[\"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0\"],\"scale\":\"ratio\"},\"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0\":{\"customLabel\":true,\"dataType\":\"number\",\"isBucketed\":false,\"label\":\"Part
of
median(bytes)\",\"operationType\":\"median\",\"params\":{\"emptyAsNull\":false},\"scale\":\"ratio\",\"sourceField\":\"bytes\"}},\"incompleteColumns\":{},\"sampling\":1}}},\"indexpattern\":{\"layers\":{}},\"textBased\":{\"layers\":{}}},\"filters\":[],\"internalReferences\":[],\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"visualization\":{\"axisTitlesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"fittingFunction\":\"None\",\"gridlinesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"labelsOrientation\":{\"x\":0,\"yLeft\":0,\"yRight\":0},\"layers\":[{\"accessors\":[\"36d445ea-dd2a-4b13-96e2-d51d07d98f70\"],\"layerId\":\"7945fa55-b9ea-4b10-a498-e265ef192d7d\",\"layerType\":\"data\",\"position\":\"top\",\"seriesType\":\"bar_stacked\",\"showGridlines\":false,\"xAccessor\":\"207508ea-7433-494f-9925-70d55831c74c\"}],\"legend\":{\"isVisible\":true,\"position\":\"right\"},\"preferredSeriesType\":\"bar_stacked\",\"tickLabelsVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"valueLabels\":\"hide\"}},\"title\":\"Vis
with
formula\",\"visualizationType\":\"lnsXY\"},\"coreMigrationVersion\":\"8.8.0\",\"created_at\":\"2024-01-25T21:12:58.923Z\",\"id\":\"2139b4e8-ee7c-41dc-9564-74b7c1e54216\",\"managed\":false,\"references\":[{\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"name\":\"indexpattern-datasource-layer-7945fa55-b9ea-4b10-a498-e265ef192d7d\",\"type\":\"index-pattern\"}],\"type\":\"lens\",\"typeMigrationVersion\":\"8.9.0\",\"updated_at\":\"2024-01-25T21:12:58.923Z\",\"version\":\"WzgwLDFd\"}\r\n{\"excludedObjects\":[],\"excludedObjectsCount\":0,\"exportedCount\":2,\"missingRefCount\":0,\"missingReferences\":[]}\r\n```\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [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- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] Any UI
touched in this PR does not create any new axe failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[ ] If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"0dfff4c208d4c4c78c14c8b46dff841689623ee4","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","Feature:Lens","backport:prev-minor","v8.12.1","v8.13.0"],"title":"[Lens]
stop gap solution for invalid formula and math
columns","number":175644,"url":"https://github.com/elastic/kibana/pull/175644","mergeCommit":{"message":"[Lens]
stop gap solution for invalid formula and math columns (#175644)\n\n##
Summary\r\n\r\nA stop-gap solution for
https://github.com/elastic/kibana/issues/168561\r\n\r\nThis
visualization can be used to
test.\r\n\r\n```\r\n{\"attributes\":{\"fieldFormatMap\":\"{\\\"hour_of_day\\\":{}}\",\"name\":\"Kibana
Sample Data
Logs\",\"runtimeFieldMap\":\"{\\\"hour_of_day\\\":{\\\"type\\\":\\\"long\\\",\\\"script\\\":{\\\"source\\\":\\\"emit(doc['timestamp'].value.getHour());\\\"}}}\",\"timeFieldName\":\"timestamp\",\"title\":\"kibana_sample_data_logs\"},\"coreMigrationVersion\":\"8.8.0\",\"created_at\":\"2024-01-24T19:57:34.193Z\",\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"managed\":false,\"references\":[],\"type\":\"index-pattern\",\"typeMigrationVersion\":\"8.0.0\",\"updated_at\":\"2024-01-24T19:57:34.193Z\",\"version\":\"WzM1LDFd\"}\r\n{\"attributes\":{\"description\":\"\",\"state\":{\"adHocDataViews\":{},\"datasourceStates\":{\"formBased\":{\"layers\":{\"7945fa55-b9ea-4b10-a498-e265ef192d7d\":{\"columnOrder\":[\"207508ea-7433-494f-9925-70d55831c74c\",\"36d445ea-dd2a-4b13-96e2-d51d07d98f70\",\"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0\"],\"columns\":{\"207508ea-7433-494f-9925-70d55831c74c\":{\"dataType\":\"date\",\"isBucketed\":true,\"label\":\"timestamp\",\"operationType\":\"date_histogram\",\"params\":{\"dropPartials\":false,\"includeEmptyRows\":true,\"interval\":\"auto\"},\"scale\":\"interval\",\"sourceField\":\"timestamp\"},\"36d445ea-dd2a-4b13-96e2-d51d07d98f70\":{\"dataType\":\"number\",\"isBucketed\":false,\"label\":\"median(bytes)\",\"operationType\":\"formula\",\"sourceField\":\"___records___\",\"params\":{\"formula\":\"median(bytes)\",\"isFormulaBroken\":false},\"references\":[\"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0\"],\"scale\":\"ratio\"},\"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0\":{\"customLabel\":true,\"dataType\":\"number\",\"isBucketed\":false,\"label\":\"Part
of
median(bytes)\",\"operationType\":\"median\",\"params\":{\"emptyAsNull\":false},\"scale\":\"ratio\",\"sourceField\":\"bytes\"}},\"incompleteColumns\":{},\"sampling\":1}}},\"indexpattern\":{\"layers\":{}},\"textBased\":{\"layers\":{}}},\"filters\":[],\"internalReferences\":[],\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"visualization\":{\"axisTitlesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"fittingFunction\":\"None\",\"gridlinesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"labelsOrientation\":{\"x\":0,\"yLeft\":0,\"yRight\":0},\"layers\":[{\"accessors\":[\"36d445ea-dd2a-4b13-96e2-d51d07d98f70\"],\"layerId\":\"7945fa55-b9ea-4b10-a498-e265ef192d7d\",\"layerType\":\"data\",\"position\":\"top\",\"seriesType\":\"bar_stacked\",\"showGridlines\":false,\"xAccessor\":\"207508ea-7433-494f-9925-70d55831c74c\"}],\"legend\":{\"isVisible\":true,\"position\":\"right\"},\"preferredSeriesType\":\"bar_stacked\",\"tickLabelsVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"valueLabels\":\"hide\"}},\"title\":\"Vis
with
formula\",\"visualizationType\":\"lnsXY\"},\"coreMigrationVersion\":\"8.8.0\",\"created_at\":\"2024-01-25T21:12:58.923Z\",\"id\":\"2139b4e8-ee7c-41dc-9564-74b7c1e54216\",\"managed\":false,\"references\":[{\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"name\":\"indexpattern-datasource-layer-7945fa55-b9ea-4b10-a498-e265ef192d7d\",\"type\":\"index-pattern\"}],\"type\":\"lens\",\"typeMigrationVersion\":\"8.9.0\",\"updated_at\":\"2024-01-25T21:12:58.923Z\",\"version\":\"WzgwLDFd\"}\r\n{\"excludedObjects\":[],\"excludedObjectsCount\":0,\"exportedCount\":2,\"missingRefCount\":0,\"missingReferences\":[]}\r\n```\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [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- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] Any UI
touched in this PR does not create any new axe failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[ ] If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"0dfff4c208d4c4c78c14c8b46dff841689623ee4"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/175644","number":175644,"mergeCommit":{"message":"[Lens]
stop gap solution for invalid formula and math columns (#175644)\n\n##
Summary\r\n\r\nA stop-gap solution for
https://github.com/elastic/kibana/issues/168561\r\n\r\nThis
visualization can be used to
test.\r\n\r\n```\r\n{\"attributes\":{\"fieldFormatMap\":\"{\\\"hour_of_day\\\":{}}\",\"name\":\"Kibana
Sample Data
Logs\",\"runtimeFieldMap\":\"{\\\"hour_of_day\\\":{\\\"type\\\":\\\"long\\\",\\\"script\\\":{\\\"source\\\":\\\"emit(doc['timestamp'].value.getHour());\\\"}}}\",\"timeFieldName\":\"timestamp\",\"title\":\"kibana_sample_data_logs\"},\"coreMigrationVersion\":\"8.8.0\",\"created_at\":\"2024-01-24T19:57:34.193Z\",\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"managed\":false,\"references\":[],\"type\":\"index-pattern\",\"typeMigrationVersion\":\"8.0.0\",\"updated_at\":\"2024-01-24T19:57:34.193Z\",\"version\":\"WzM1LDFd\"}\r\n{\"attributes\":{\"description\":\"\",\"state\":{\"adHocDataViews\":{},\"datasourceStates\":{\"formBased\":{\"layers\":{\"7945fa55-b9ea-4b10-a498-e265ef192d7d\":{\"columnOrder\":[\"207508ea-7433-494f-9925-70d55831c74c\",\"36d445ea-dd2a-4b13-96e2-d51d07d98f70\",\"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0\"],\"columns\":{\"207508ea-7433-494f-9925-70d55831c74c\":{\"dataType\":\"date\",\"isBucketed\":true,\"label\":\"timestamp\",\"operationType\":\"date_histogram\",\"params\":{\"dropPartials\":false,\"includeEmptyRows\":true,\"interval\":\"auto\"},\"scale\":\"interval\",\"sourceField\":\"timestamp\"},\"36d445ea-dd2a-4b13-96e2-d51d07d98f70\":{\"dataType\":\"number\",\"isBucketed\":false,\"label\":\"median(bytes)\",\"operationType\":\"formula\",\"sourceField\":\"___records___\",\"params\":{\"formula\":\"median(bytes)\",\"isFormulaBroken\":false},\"references\":[\"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0\"],\"scale\":\"ratio\"},\"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0\":{\"customLabel\":true,\"dataType\":\"number\",\"isBucketed\":false,\"label\":\"Part
of
median(bytes)\",\"operationType\":\"median\",\"params\":{\"emptyAsNull\":false},\"scale\":\"ratio\",\"sourceField\":\"bytes\"}},\"incompleteColumns\":{},\"sampling\":1}}},\"indexpattern\":{\"layers\":{}},\"textBased\":{\"layers\":{}}},\"filters\":[],\"internalReferences\":[],\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"visualization\":{\"axisTitlesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"fittingFunction\":\"None\",\"gridlinesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"labelsOrientation\":{\"x\":0,\"yLeft\":0,\"yRight\":0},\"layers\":[{\"accessors\":[\"36d445ea-dd2a-4b13-96e2-d51d07d98f70\"],\"layerId\":\"7945fa55-b9ea-4b10-a498-e265ef192d7d\",\"layerType\":\"data\",\"position\":\"top\",\"seriesType\":\"bar_stacked\",\"showGridlines\":false,\"xAccessor\":\"207508ea-7433-494f-9925-70d55831c74c\"}],\"legend\":{\"isVisible\":true,\"position\":\"right\"},\"preferredSeriesType\":\"bar_stacked\",\"tickLabelsVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"valueLabels\":\"hide\"}},\"title\":\"Vis
with
formula\",\"visualizationType\":\"lnsXY\"},\"coreMigrationVersion\":\"8.8.0\",\"created_at\":\"2024-01-25T21:12:58.923Z\",\"id\":\"2139b4e8-ee7c-41dc-9564-74b7c1e54216\",\"managed\":false,\"references\":[{\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"name\":\"indexpattern-datasource-layer-7945fa55-b9ea-4b10-a498-e265ef192d7d\",\"type\":\"index-pattern\"}],\"type\":\"lens\",\"typeMigrationVersion\":\"8.9.0\",\"updated_at\":\"2024-01-25T21:12:58.923Z\",\"version\":\"WzgwLDFd\"}\r\n{\"excludedObjects\":[],\"excludedObjectsCount\":0,\"exportedCount\":2,\"missingRefCount\":0,\"missingReferences\":[]}\r\n```\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [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- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] Any UI
touched in this PR does not create any new axe failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[ ] If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"0dfff4c208d4c4c78c14c8b46dff841689623ee4"}}]}]
BACKPORT-->

Co-authored-by: Drew Tate <drew.tate@elastic.co>
lcawl pushed a commit to lcawl/kibana that referenced this issue Jan 26, 2024
…c#175644)

## Summary

A stop-gap solution for elastic#168561

This visualization can be used to test.

```
{"attributes":{"fieldFormatMap":"{\"hour_of_day\":{}}","name":"Kibana Sample Data Logs","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_logs"},"coreMigrationVersion":"8.8.0","created_at":"2024-01-24T19:57:34.193Z","id":"90943e30-9a47-11e8-b64d-95841ca0b247","managed":false,"references":[],"type":"index-pattern","typeMigrationVersion":"8.0.0","updated_at":"2024-01-24T19:57:34.193Z","version":"WzM1LDFd"}
{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"7945fa55-b9ea-4b10-a498-e265ef192d7d":{"columnOrder":["207508ea-7433-494f-9925-70d55831c74c","36d445ea-dd2a-4b13-96e2-d51d07d98f70","36d445ea-dd2a-4b13-96e2-d51d07d98f70X0"],"columns":{"207508ea-7433-494f-9925-70d55831c74c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"36d445ea-dd2a-4b13-96e2-d51d07d98f70":{"dataType":"number","isBucketed":false,"label":"median(bytes)","operationType":"formula","sourceField":"___records___","params":{"formula":"median(bytes)","isFormulaBroken":false},"references":["36d445ea-dd2a-4b13-96e2-d51d07d98f70X0"],"scale":"ratio"},"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of median(bytes)","operationType":"median","params":{"emptyAsNull":false},"scale":"ratio","sourceField":"bytes"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["36d445ea-dd2a-4b13-96e2-d51d07d98f70"],"layerId":"7945fa55-b9ea-4b10-a498-e265ef192d7d","layerType":"data","position":"top","seriesType":"bar_stacked","showGridlines":false,"xAccessor":"207508ea-7433-494f-9925-70d55831c74c"}],"legend":{"isVisible":true,"position":"right"},"preferredSeriesType":"bar_stacked","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide"}},"title":"Vis with formula","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-01-25T21:12:58.923Z","id":"2139b4e8-ee7c-41dc-9564-74b7c1e54216","managed":false,"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-7945fa55-b9ea-4b10-a498-e265ef192d7d","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-01-25T21:12:58.923Z","version":"WzgwLDFd"}
{"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":2,"missingRefCount":0,"missingReferences":[]}
```

### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this issue Feb 15, 2024
…c#175644)

## Summary

A stop-gap solution for elastic#168561

This visualization can be used to test.

```
{"attributes":{"fieldFormatMap":"{\"hour_of_day\":{}}","name":"Kibana Sample Data Logs","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_logs"},"coreMigrationVersion":"8.8.0","created_at":"2024-01-24T19:57:34.193Z","id":"90943e30-9a47-11e8-b64d-95841ca0b247","managed":false,"references":[],"type":"index-pattern","typeMigrationVersion":"8.0.0","updated_at":"2024-01-24T19:57:34.193Z","version":"WzM1LDFd"}
{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"7945fa55-b9ea-4b10-a498-e265ef192d7d":{"columnOrder":["207508ea-7433-494f-9925-70d55831c74c","36d445ea-dd2a-4b13-96e2-d51d07d98f70","36d445ea-dd2a-4b13-96e2-d51d07d98f70X0"],"columns":{"207508ea-7433-494f-9925-70d55831c74c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"36d445ea-dd2a-4b13-96e2-d51d07d98f70":{"dataType":"number","isBucketed":false,"label":"median(bytes)","operationType":"formula","sourceField":"___records___","params":{"formula":"median(bytes)","isFormulaBroken":false},"references":["36d445ea-dd2a-4b13-96e2-d51d07d98f70X0"],"scale":"ratio"},"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of median(bytes)","operationType":"median","params":{"emptyAsNull":false},"scale":"ratio","sourceField":"bytes"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["36d445ea-dd2a-4b13-96e2-d51d07d98f70"],"layerId":"7945fa55-b9ea-4b10-a498-e265ef192d7d","layerType":"data","position":"top","seriesType":"bar_stacked","showGridlines":false,"xAccessor":"207508ea-7433-494f-9925-70d55831c74c"}],"legend":{"isVisible":true,"position":"right"},"preferredSeriesType":"bar_stacked","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide"}},"title":"Vis with formula","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-01-25T21:12:58.923Z","id":"2139b4e8-ee7c-41dc-9564-74b7c1e54216","managed":false,"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-7945fa55-b9ea-4b10-a498-e265ef192d7d","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-01-25T21:12:58.923Z","version":"WzgwLDFd"}
{"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":2,"missingRefCount":0,"missingReferences":[]}
```

### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this issue Feb 15, 2024
…c#175644)

## Summary

A stop-gap solution for elastic#168561

This visualization can be used to test.

```
{"attributes":{"fieldFormatMap":"{\"hour_of_day\":{}}","name":"Kibana Sample Data Logs","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_logs"},"coreMigrationVersion":"8.8.0","created_at":"2024-01-24T19:57:34.193Z","id":"90943e30-9a47-11e8-b64d-95841ca0b247","managed":false,"references":[],"type":"index-pattern","typeMigrationVersion":"8.0.0","updated_at":"2024-01-24T19:57:34.193Z","version":"WzM1LDFd"}
{"attributes":{"description":"","state":{"adHocDataViews":{},"datasourceStates":{"formBased":{"layers":{"7945fa55-b9ea-4b10-a498-e265ef192d7d":{"columnOrder":["207508ea-7433-494f-9925-70d55831c74c","36d445ea-dd2a-4b13-96e2-d51d07d98f70","36d445ea-dd2a-4b13-96e2-d51d07d98f70X0"],"columns":{"207508ea-7433-494f-9925-70d55831c74c":{"dataType":"date","isBucketed":true,"label":"timestamp","operationType":"date_histogram","params":{"dropPartials":false,"includeEmptyRows":true,"interval":"auto"},"scale":"interval","sourceField":"timestamp"},"36d445ea-dd2a-4b13-96e2-d51d07d98f70":{"dataType":"number","isBucketed":false,"label":"median(bytes)","operationType":"formula","sourceField":"___records___","params":{"formula":"median(bytes)","isFormulaBroken":false},"references":["36d445ea-dd2a-4b13-96e2-d51d07d98f70X0"],"scale":"ratio"},"36d445ea-dd2a-4b13-96e2-d51d07d98f70X0":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of median(bytes)","operationType":"median","params":{"emptyAsNull":false},"scale":"ratio","sourceField":"bytes"}},"incompleteColumns":{},"sampling":1}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"filters":[],"internalReferences":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"layers":[{"accessors":["36d445ea-dd2a-4b13-96e2-d51d07d98f70"],"layerId":"7945fa55-b9ea-4b10-a498-e265ef192d7d","layerType":"data","position":"top","seriesType":"bar_stacked","showGridlines":false,"xAccessor":"207508ea-7433-494f-9925-70d55831c74c"}],"legend":{"isVisible":true,"position":"right"},"preferredSeriesType":"bar_stacked","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide"}},"title":"Vis with formula","visualizationType":"lnsXY"},"coreMigrationVersion":"8.8.0","created_at":"2024-01-25T21:12:58.923Z","id":"2139b4e8-ee7c-41dc-9564-74b7c1e54216","managed":false,"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-7945fa55-b9ea-4b10-a498-e265ef192d7d","type":"index-pattern"}],"type":"lens","typeMigrationVersion":"8.9.0","updated_at":"2024-01-25T21:12:58.923Z","version":"WzgwLDFd"}
{"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":2,"missingRefCount":0,"missingReferences":[]}
```

### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
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 impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

6 participants