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

Fix broken CSV export from data table. #34131

Merged
merged 2 commits into from Apr 1, 2019

Conversation

lukeelmers
Copy link
Member

Fixes #33581

In 7.0 and later, the clicking to download a raw or formatted CSV from the data table vis failed. I think this may have been introduced in #28746, though not 100% sure.

This updates agg_table to handle tabified data, and also makes sure that formatter.convert is called for each value when exporting formatted CSV.

We have tests that would have caught this, but they were using mocked data in the old format so they were still passing & giving a false positive. I've updated those as well & added a few new tests.

@lukeelmers lukeelmers added Feature:Data Table Data table visualization feature regression v7.0.0 Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 v7.2.0 labels Mar 28, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@@ -30,21 +30,21 @@ import { fieldFormats } from '../../../registry/field_formats';

const config = chrome.getUiSettingsClient();

const defaultFormat = { convert: identity };
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird thing I noticed when writing tests: the way we had defined the default formatter, the same object was being passed to every field that used the default format, which meant mutating convert on one field would actually change all the default fields.

I wasn't sure how likely it would be for this to cause problems in the real world, but went ahead and changed it anyway just to be safe.

@elasticmachine

This comment has been minimized.

@lukeelmers

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@lukeelmers lukeelmers added the release_note:skip Skip the PR/issue when compiling release notes label Mar 29, 2019
@lukeelmers lukeelmers added release_note:fix and removed release_note:skip Skip the PR/issue when compiling release notes labels Mar 29, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested on chrome linux

@lukeelmers lukeelmers merged commit 37f9994 into elastic:master Apr 1, 2019
@lukeelmers lukeelmers deleted the fix/data-table-export branch April 1, 2019 17:01
lukeelmers added a commit to lukeelmers/kibana that referenced this pull request Apr 1, 2019
lukeelmers added a commit to lukeelmers/kibana that referenced this pull request Apr 1, 2019
@lukeelmers
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Data Table Data table visualization feature regression release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.0.0 v7.2.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants