{"action":"created","comment":{"url":"https://api.github.com/repos/getredash/redash/pulls/comments/106883321","pull_request_review_id":27824574,"id":106883321,"diff_hunk":"@@ -21,7 +22,19 @@ function pivotTableRenderer() {\n         if ($scope.queryResult.getData() !== null) {\n           // We need to give the pivot table its own copy of the data, because it changes\n           // it which interferes with other visualizations.\n-          data = angular.copy($scope.queryResult.getRawData());\n+          data = [];\n+          const columns = $scope.queryResult.getColumns();\n+          const rows = $scope.queryResult.getData();\n+          rows.forEach((row) => {\n+            const rowObj = {};\n+            columns.forEach((col) => {\n+              const colName = getColumnCleanName(col.name);\n+              const value = formatValue($filter, clientConfig, row[col.name], col.type);","path":"client/app/visualizations/pivot/index.js","position":25,"original_position":25,"commit_id":"f011d3060a6b5ef0882a86937463b9bd704bfd04","original_commit_id":"f011d3060a6b5ef0882a86937463b9bd704bfd04","user":{"login":"deecay","id":1698635,"avatar_url":"https://avatars1.githubusercontent.com/u/1698635?v=3","gravatar_id":"","url":"https://api.github.com/users/deecay","html_url":"https://github.com/deecay","followers_url":"https://api.github.com/users/deecay/followers","following_url":"https://api.github.com/users/deecay/following{/other_user}","gists_url":"https://api.github.com/users/deecay/gists{/gist_id}","starred_url":"https://api.github.com/users/deecay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deecay/subscriptions","organizations_url":"https://api.github.com/users/deecay/orgs","repos_url":"https://api.github.com/users/deecay/repos","events_url":"https://api.github.com/users/deecay/events{/privacy}","received_events_url":"https://api.github.com/users/deecay/received_events","type":"User","site_admin":false},"body":"Yes they do. Example is [here](http://nicolas.kruchten.com/pivottable/examples/mps_agg.html).\r\nI have to come up with how to let people define it in pivottable editor, but currently have no idea.\r\n\r\nI'm perfectly fine with dividing this PR into two, and making this only about the filters.\r\nI assume what you mean is just replacing `.getRawData()` to `.getData()`?","created_at":"2017-03-20T11:55:40Z","updated_at":"2017-03-20T11:55:40Z","html_url":"https://github.com/getredash/redash/pull/1666#discussion_r106883321","pull_request_url":"https://api.github.com/repos/getredash/redash/pulls/1666","_links":{"self":{"href":"https://api.github.com/repos/getredash/redash/pulls/comments/106883321"},"html":{"href":"https://github.com/getredash/redash/pull/1666#discussion_r106883321"},"pull_request":{"href":"https://api.github.com/repos/getredash/redash/pulls/1666"}}},"pull_request":{"url":"https://api.github.com/repos/getredash/redash/pulls/1666","id":110104194,"html_url":"https://github.com/getredash/redash/pull/1666","diff_url":"https://github.com/getredash/redash/pull/1666.diff","patch_url":"https://github.com/getredash/redash/pull/1666.patch","issue_url":"https://api.github.com/repos/getredash/redash/issues/1666","number":1666,"state":"open","locked":false,"title":"Pivottable should show filtered and formatted data","user":{"login":"deecay","id":1698635,"avatar_url":"https://avatars1.githubusercontent.com/u/1698635?v=3","gravatar_id":"","url":"https://api.github.com/users/deecay","html_url":"https://github.com/deecay","followers_url":"https://api.github.com/users/deecay/followers","following_url":"https://api.github.com/users/deecay/following{/other_user}","gists_url":"https://api.github.com/users/deecay/gists{/gist_id}","starred_url":"https://api.github.com/users/deecay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deecay/subscriptions","organizations_url":"https://api.github.com/users/deecay/orgs","repos_url":"https://api.github.com/users/deecay/repos","events_url":"https://api.github.com/users/deecay/events{/privacy}","received_events_url":"https://api.github.com/users/deecay/received_events","type":"User","site_admin":false},"body":"This PR changes how the `data` fed to pivottable visualization is prepared, and makes pivottable show filtered and formatted data just as you can see in Table visualization.\r\n\r\nI have noticed that pivottable visualization:\r\n* does not incorporate query/dashboard filter\r\n* `::filter` annotation appears as part of pivottable attribute name and does not get removed\r\n* date and datetime columns does not respect `REDASH_DATE_FORMAT`\r\n\r\nThis PR addresses all three points.","created_at":"2017-03-10T10:48:35Z","updated_at":"2017-03-20T11:55:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"927e2e54f238444e47f3c751b371ce59ae9231d8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/getredash/redash/pulls/1666/commits","review_comments_url":"https://api.github.com/repos/getredash/redash/pulls/1666/comments","review_comment_url":"https://api.github.com/repos/getredash/redash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/getredash/redash/issues/1666/comments","statuses_url":"https://api.github.com/repos/getredash/redash/statuses/f011d3060a6b5ef0882a86937463b9bd704bfd04","head":{"label":"deecay:pivot-getdata","ref":"pivot-getdata","sha":"f011d3060a6b5ef0882a86937463b9bd704bfd04","user":{"login":"deecay","id":1698635,"avatar_url":"https://avatars1.githubusercontent.com/u/1698635?v=3","gravatar_id":"","url":"https://api.github.com/users/deecay","html_url":"https://github.com/deecay","followers_url":"https://api.github.com/users/deecay/followers","following_url":"https://api.github.com/users/deecay/following{/other_user}","gists_url":"https://api.github.com/users/deecay/gists{/gist_id}","starred_url":"https://api.github.com/users/deecay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deecay/subscriptions","organizations_url":"https://api.github.com/users/deecay/orgs","repos_url":"https://api.github.com/users/deecay/repos","events_url":"https://api.github.com/users/deecay/events{/privacy}","received_events_url":"https://api.github.com/users/deecay/received_events","type":"User","site_admin":false},"repo":{"id":81638249,"name":"redash","full_name":"deecay/redash","owner":{"login":"deecay","id":1698635,"avatar_url":"https://avatars1.githubusercontent.com/u/1698635?v=3","gravatar_id":"","url":"https://api.github.com/users/deecay","html_url":"https://github.com/deecay","followers_url":"https://api.github.com/users/deecay/followers","following_url":"https://api.github.com/users/deecay/following{/other_user}","gists_url":"https://api.github.com/users/deecay/gists{/gist_id}","starred_url":"https://api.github.com/users/deecay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deecay/subscriptions","organizations_url":"https://api.github.com/users/deecay/orgs","repos_url":"https://api.github.com/users/deecay/repos","events_url":"https://api.github.com/users/deecay/events{/privacy}","received_events_url":"https://api.github.com/users/deecay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deecay/redash","description":"Make Your Company Data Driven. Connect to any data source, easily visualize and share your data.","fork":true,"url":"https://api.github.com/repos/deecay/redash","forks_url":"https://api.github.com/repos/deecay/redash/forks","keys_url":"https://api.github.com/repos/deecay/redash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deecay/redash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deecay/redash/teams","hooks_url":"https://api.github.com/repos/deecay/redash/hooks","issue_events_url":"https://api.github.com/repos/deecay/redash/issues/events{/number}","events_url":"https://api.github.com/repos/deecay/redash/events","assignees_url":"https://api.github.com/repos/deecay/redash/assignees{/user}","branches_url":"https://api.github.com/repos/deecay/redash/branches{/branch}","tags_url":"https://api.github.com/repos/deecay/redash/tags","blobs_url":"https://api.github.com/repos/deecay/redash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deecay/redash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deecay/redash/git/refs{/sha}","trees_url":"https://api.github.com/repos/deecay/redash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deecay/redash/statuses/{sha}","languages_url":"https://api.github.com/repos/deecay/redash/languages","stargazers_url":"https://api.github.com/repos/deecay/redash/stargazers","contributors_url":"https://api.github.com/repos/deecay/redash/contributors","subscribers_url":"https://api.github.com/repos/deecay/redash/subscribers","subscription_url":"https://api.github.com/repos/deecay/redash/subscription","commits_url":"https://api.github.com/repos/deecay/redash/commits{/sha}","git_commits_url":"https://api.github.com/repos/deecay/redash/git/commits{/sha}","comments_url":"https://api.github.com/repos/deecay/redash/comments{/number}","issue_comment_url":"https://api.github.com/repos/deecay/redash/issues/comments{/number}","contents_url":"https://api.github.com/repos/deecay/redash/contents/{+path}","compare_url":"https://api.github.com/repos/deecay/redash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deecay/redash/merges","archive_url":"https://api.github.com/repos/deecay/redash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deecay/redash/downloads","issues_url":"https://api.github.com/repos/deecay/redash/issues{/number}","pulls_url":"https://api.github.com/repos/deecay/redash/pulls{/number}","milestones_url":"https://api.github.com/repos/deecay/redash/milestones{/number}","notifications_url":"https://api.github.com/repos/deecay/redash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deecay/redash/labels{/name}","releases_url":"https://api.github.com/repos/deecay/redash/releases{/id}","deployments_url":"https://api.github.com/repos/deecay/redash/deployments","created_at":"2017-02-11T07:32:58Z","updated_at":"2017-02-11T07:33:02Z","pushed_at":"2017-03-17T00:05:52Z","git_url":"git://github.com/deecay/redash.git","ssh_url":"git@github.com:deecay/redash.git","clone_url":"https://github.com/deecay/redash.git","svn_url":"https://github.com/deecay/redash","homepage":"http://redash.io/","size":8062,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"getredash:master","ref":"master","sha":"da00e74491bb98be4c49421889e6350be3ec12fb","user":{"login":"getredash","id":10746780,"avatar_url":"https://avatars1.githubusercontent.com/u/10746780?v=3","gravatar_id":"","url":"https://api.github.com/users/getredash","html_url":"https://github.com/getredash","followers_url":"https://api.github.com/users/getredash/followers","following_url":"https://api.github.com/users/getredash/following{/other_user}","gists_url":"https://api.github.com/users/getredash/gists{/gist_id}","starred_url":"https://api.github.com/users/getredash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getredash/subscriptions","organizations_url":"https://api.github.com/users/getredash/orgs","repos_url":"https://api.github.com/users/getredash/repos","events_url":"https://api.github.com/users/getredash/events{/privacy}","received_events_url":"https://api.github.com/users/getredash/received_events","type":"Organization","site_admin":false},"repo":{"id":13926404,"name":"redash","full_name":"getredash/redash","owner":{"login":"getredash","id":10746780,"avatar_url":"https://avatars1.githubusercontent.com/u/10746780?v=3","gravatar_id":"","url":"https://api.github.com/users/getredash","html_url":"https://github.com/getredash","followers_url":"https://api.github.com/users/getredash/followers","following_url":"https://api.github.com/users/getredash/following{/other_user}","gists_url":"https://api.github.com/users/getredash/gists{/gist_id}","starred_url":"https://api.github.com/users/getredash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getredash/subscriptions","organizations_url":"https://api.github.com/users/getredash/orgs","repos_url":"https://api.github.com/users/getredash/repos","events_url":"https://api.github.com/users/getredash/events{/privacy}","received_events_url":"https://api.github.com/users/getredash/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getredash/redash","description":"Make Your Company Data Driven. Connect to any data source, easily visualize and share your data.","fork":false,"url":"https://api.github.com/repos/getredash/redash","forks_url":"https://api.github.com/repos/getredash/redash/forks","keys_url":"https://api.github.com/repos/getredash/redash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getredash/redash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getredash/redash/teams","hooks_url":"https://api.github.com/repos/getredash/redash/hooks","issue_events_url":"https://api.github.com/repos/getredash/redash/issues/events{/number}","events_url":"https://api.github.com/repos/getredash/redash/events","assignees_url":"https://api.github.com/repos/getredash/redash/assignees{/user}","branches_url":"https://api.github.com/repos/getredash/redash/branches{/branch}","tags_url":"https://api.github.com/repos/getredash/redash/tags","blobs_url":"https://api.github.com/repos/getredash/redash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getredash/redash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getredash/redash/git/refs{/sha}","trees_url":"https://api.github.com/repos/getredash/redash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getredash/redash/statuses/{sha}","languages_url":"https://api.github.com/repos/getredash/redash/languages","stargazers_url":"https://api.github.com/repos/getredash/redash/stargazers","contributors_url":"https://api.github.com/repos/getredash/redash/contributors","subscribers_url":"https://api.github.com/repos/getredash/redash/subscribers","subscription_url":"https://api.github.com/repos/getredash/redash/subscription","commits_url":"https://api.github.com/repos/getredash/redash/commits{/sha}","git_commits_url":"https://api.github.com/repos/getredash/redash/git/commits{/sha}","comments_url":"https://api.github.com/repos/getredash/redash/comments{/number}","issue_comment_url":"https://api.github.com/repos/getredash/redash/issues/comments{/number}","contents_url":"https://api.github.com/repos/getredash/redash/contents/{+path}","compare_url":"https://api.github.com/repos/getredash/redash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getredash/redash/merges","archive_url":"https://api.github.com/repos/getredash/redash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getredash/redash/downloads","issues_url":"https://api.github.com/repos/getredash/redash/issues{/number}","pulls_url":"https://api.github.com/repos/getredash/redash/pulls{/number}","milestones_url":"https://api.github.com/repos/getredash/redash/milestones{/number}","notifications_url":"https://api.github.com/repos/getredash/redash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getredash/redash/labels{/name}","releases_url":"https://api.github.com/repos/getredash/redash/releases{/id}","deployments_url":"https://api.github.com/repos/getredash/redash/deployments","created_at":"2013-10-28T13:19:39Z","updated_at":"2017-03-19T20:27:57Z","pushed_at":"2017-03-20T08:54:59Z","git_url":"git://github.com/getredash/redash.git","ssh_url":"git@github.com:getredash/redash.git","clone_url":"https://github.com/getredash/redash.git","svn_url":"https://github.com/getredash/redash","homepage":"http://redash.io/","size":8080,"stargazers_count":6206,"watchers_count":6206,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":797,"mirror_url":null,"open_issues_count":182,"forks":797,"open_issues":182,"watchers":6206,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/getredash/redash/pulls/1666"},"html":{"href":"https://github.com/getredash/redash/pull/1666"},"issue":{"href":"https://api.github.com/repos/getredash/redash/issues/1666"},"comments":{"href":"https://api.github.com/repos/getredash/redash/issues/1666/comments"},"review_comments":{"href":"https://api.github.com/repos/getredash/redash/pulls/1666/comments"},"review_comment":{"href":"https://api.github.com/repos/getredash/redash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/getredash/redash/pulls/1666/commits"},"statuses":{"href":"https://api.github.com/repos/getredash/redash/statuses/f011d3060a6b5ef0882a86937463b9bd704bfd04"}}}}
{"actor":{"display_login":"deecay"}}