{"action":"created","comment":{"url":"https://api.github.com/repos/EverythingMe/redash/pulls/comments/35219675","id":35219675,"diff_hunk":"@@ -187,9 +184,9 @@ def run_query(self, query):\n             #       One option is to use ETA with Celery + timeouts on workers\n             #       And replacement of worker process every X requests handled.\n \n-            exec(code) in restricted_globals, script_locals\n+            exec(code) in restricted_globals, self._script_locals\n \n-            json_data = json.dumps(self._result)","path":"redash/query_runner/python.py","position":31,"original_position":31,"commit_id":"6a9d95f1ac67ea7b091a35da6ad05766c2740fb6","original_commit_id":"6a9d95f1ac67ea7b091a35da6ad05766c2740fb6","user":{"login":"erans","id":10771,"avatar_url":"https://avatars.githubusercontent.com/u/10771?v=3","gravatar_id":"","url":"https://api.github.com/users/erans","html_url":"https://github.com/erans","followers_url":"https://api.github.com/users/erans/followers","following_url":"https://api.github.com/users/erans/following{/other_user}","gists_url":"https://api.github.com/users/erans/gists{/gist_id}","starred_url":"https://api.github.com/users/erans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erans/subscriptions","organizations_url":"https://api.github.com/users/erans/orgs","repos_url":"https://api.github.com/users/erans/repos","events_url":"https://api.github.com/users/erans/events{/privacy}","received_events_url":"https://api.github.com/users/erans/received_events","type":"User","site_admin":false},"body":"I had to do it due to scoping issue and the support for the print statement\n\nOn Wed, Jul 22, 2015, 17:37 Arik Fraimovich <notifications@github.com>\nwrote:\n\n> In redash/query_runner/python.py\n> <https://github.com/EverythingMe/redash/pull/503#discussion_r35219495>:\n>\n> >\n> > -            json_data = json.dumps(self._result)\n>\n> @erans <https://github.com/erans> FYI.\n>\n> The problem was here: if you set a different object to result in the\n> script, then self._result will no longer reference to it.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/EverythingMe/redash/pull/503/files#r35219495>.\n>\n","created_at":"2015-07-22T14:39:17Z","updated_at":"2015-07-22T14:39:17Z","html_url":"https://github.com/EverythingMe/redash/pull/503#discussion_r35219675","pull_request_url":"https://api.github.com/repos/EverythingMe/redash/pulls/503","_links":{"self":{"href":"https://api.github.com/repos/EverythingMe/redash/pulls/comments/35219675"},"html":{"href":"https://github.com/EverythingMe/redash/pull/503#discussion_r35219675"},"pull_request":{"href":"https://api.github.com/repos/EverythingMe/redash/pulls/503"}}},"pull_request":{"url":"https://api.github.com/repos/EverythingMe/redash/pulls/503","id":40571788,"html_url":"https://github.com/EverythingMe/redash/pull/503","diff_url":"https://github.com/EverythingMe/redash/pull/503.diff","patch_url":"https://github.com/EverythingMe/redash/pull/503.patch","issue_url":"https://api.github.com/repos/EverythingMe/redash/issues/503","number":503,"state":"open","locked":false,"title":"Fix: if you change the result object, python runner wouldn't return any results","user":{"login":"arikfr","id":71468,"avatar_url":"https://avatars.githubusercontent.com/u/71468?v=3","gravatar_id":"","url":"https://api.github.com/users/arikfr","html_url":"https://github.com/arikfr","followers_url":"https://api.github.com/users/arikfr/followers","following_url":"https://api.github.com/users/arikfr/following{/other_user}","gists_url":"https://api.github.com/users/arikfr/gists{/gist_id}","starred_url":"https://api.github.com/users/arikfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arikfr/subscriptions","organizations_url":"https://api.github.com/users/arikfr/orgs","repos_url":"https://api.github.com/users/arikfr/repos","events_url":"https://api.github.com/users/arikfr/events{/privacy}","received_events_url":"https://api.github.com/users/arikfr/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-22T14:37:06Z","updated_at":"2015-07-22T14:39:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"212d5f28babf8d04e9dea2dcfe7d0325380005e9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/EverythingMe/redash/pulls/503/commits","review_comments_url":"https://api.github.com/repos/EverythingMe/redash/pulls/503/comments","review_comment_url":"https://api.github.com/repos/EverythingMe/redash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EverythingMe/redash/issues/503/comments","statuses_url":"https://api.github.com/repos/EverythingMe/redash/statuses/6a9d95f1ac67ea7b091a35da6ad05766c2740fb6","head":{"label":"EverythingMe:fix/python_result_set","ref":"fix/python_result_set","sha":"6a9d95f1ac67ea7b091a35da6ad05766c2740fb6","user":{"login":"EverythingMe","id":1861297,"avatar_url":"https://avatars.githubusercontent.com/u/1861297?v=3","gravatar_id":"","url":"https://api.github.com/users/EverythingMe","html_url":"https://github.com/EverythingMe","followers_url":"https://api.github.com/users/EverythingMe/followers","following_url":"https://api.github.com/users/EverythingMe/following{/other_user}","gists_url":"https://api.github.com/users/EverythingMe/gists{/gist_id}","starred_url":"https://api.github.com/users/EverythingMe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EverythingMe/subscriptions","organizations_url":"https://api.github.com/users/EverythingMe/orgs","repos_url":"https://api.github.com/users/EverythingMe/repos","events_url":"https://api.github.com/users/EverythingMe/events{/privacy}","received_events_url":"https://api.github.com/users/EverythingMe/received_events","type":"Organization","site_admin":false},"repo":{"id":13926404,"name":"redash","full_name":"EverythingMe/redash","owner":{"login":"EverythingMe","id":1861297,"avatar_url":"https://avatars.githubusercontent.com/u/1861297?v=3","gravatar_id":"","url":"https://api.github.com/users/EverythingMe","html_url":"https://github.com/EverythingMe","followers_url":"https://api.github.com/users/EverythingMe/followers","following_url":"https://api.github.com/users/EverythingMe/following{/other_user}","gists_url":"https://api.github.com/users/EverythingMe/gists{/gist_id}","starred_url":"https://api.github.com/users/EverythingMe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EverythingMe/subscriptions","organizations_url":"https://api.github.com/users/EverythingMe/orgs","repos_url":"https://api.github.com/users/EverythingMe/repos","events_url":"https://api.github.com/users/EverythingMe/events{/privacy}","received_events_url":"https://api.github.com/users/EverythingMe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EverythingMe/redash","description":"Rethinking how data is queried, shared and visualized. A web application that allows to easily query an existing database, share the dataset and visualize it in different ways. Oh and you can also create dashboards.","fork":false,"url":"https://api.github.com/repos/EverythingMe/redash","forks_url":"https://api.github.com/repos/EverythingMe/redash/forks","keys_url":"https://api.github.com/repos/EverythingMe/redash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EverythingMe/redash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EverythingMe/redash/teams","hooks_url":"https://api.github.com/repos/EverythingMe/redash/hooks","issue_events_url":"https://api.github.com/repos/EverythingMe/redash/issues/events{/number}","events_url":"https://api.github.com/repos/EverythingMe/redash/events","assignees_url":"https://api.github.com/repos/EverythingMe/redash/assignees{/user}","branches_url":"https://api.github.com/repos/EverythingMe/redash/branches{/branch}","tags_url":"https://api.github.com/repos/EverythingMe/redash/tags","blobs_url":"https://api.github.com/repos/EverythingMe/redash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EverythingMe/redash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EverythingMe/redash/git/refs{/sha}","trees_url":"https://api.github.com/repos/EverythingMe/redash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EverythingMe/redash/statuses/{sha}","languages_url":"https://api.github.com/repos/EverythingMe/redash/languages","stargazers_url":"https://api.github.com/repos/EverythingMe/redash/stargazers","contributors_url":"https://api.github.com/repos/EverythingMe/redash/contributors","subscribers_url":"https://api.github.com/repos/EverythingMe/redash/subscribers","subscription_url":"https://api.github.com/repos/EverythingMe/redash/subscription","commits_url":"https://api.github.com/repos/EverythingMe/redash/commits{/sha}","git_commits_url":"https://api.github.com/repos/EverythingMe/redash/git/commits{/sha}","comments_url":"https://api.github.com/repos/EverythingMe/redash/comments{/number}","issue_comment_url":"https://api.github.com/repos/EverythingMe/redash/issues/comments{/number}","contents_url":"https://api.github.com/repos/EverythingMe/redash/contents/{+path}","compare_url":"https://api.github.com/repos/EverythingMe/redash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EverythingMe/redash/merges","archive_url":"https://api.github.com/repos/EverythingMe/redash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EverythingMe/redash/downloads","issues_url":"https://api.github.com/repos/EverythingMe/redash/issues{/number}","pulls_url":"https://api.github.com/repos/EverythingMe/redash/pulls{/number}","milestones_url":"https://api.github.com/repos/EverythingMe/redash/milestones{/number}","notifications_url":"https://api.github.com/repos/EverythingMe/redash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EverythingMe/redash/labels{/name}","releases_url":"https://api.github.com/repos/EverythingMe/redash/releases{/id}","created_at":"2013-10-28T13:19:39Z","updated_at":"2015-07-22T02:44:35Z","pushed_at":"2015-07-22T14:37:06Z","git_url":"git://github.com/EverythingMe/redash.git","ssh_url":"git@github.com:EverythingMe/redash.git","clone_url":"https://github.com/EverythingMe/redash.git","svn_url":"https://github.com/EverythingMe/redash","homepage":"http://redash.io/","size":8223,"stargazers_count":729,"watchers_count":729,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":91,"mirror_url":null,"open_issues_count":68,"forks":91,"open_issues":68,"watchers":729,"default_branch":"master"}},"base":{"label":"EverythingMe:master","ref":"master","sha":"36b80fc4ef6cf5da8153d54e29934e2bc742a33a","user":{"login":"EverythingMe","id":1861297,"avatar_url":"https://avatars.githubusercontent.com/u/1861297?v=3","gravatar_id":"","url":"https://api.github.com/users/EverythingMe","html_url":"https://github.com/EverythingMe","followers_url":"https://api.github.com/users/EverythingMe/followers","following_url":"https://api.github.com/users/EverythingMe/following{/other_user}","gists_url":"https://api.github.com/users/EverythingMe/gists{/gist_id}","starred_url":"https://api.github.com/users/EverythingMe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EverythingMe/subscriptions","organizations_url":"https://api.github.com/users/EverythingMe/orgs","repos_url":"https://api.github.com/users/EverythingMe/repos","events_url":"https://api.github.com/users/EverythingMe/events{/privacy}","received_events_url":"https://api.github.com/users/EverythingMe/received_events","type":"Organization","site_admin":false},"repo":{"id":13926404,"name":"redash","full_name":"EverythingMe/redash","owner":{"login":"EverythingMe","id":1861297,"avatar_url":"https://avatars.githubusercontent.com/u/1861297?v=3","gravatar_id":"","url":"https://api.github.com/users/EverythingMe","html_url":"https://github.com/EverythingMe","followers_url":"https://api.github.com/users/EverythingMe/followers","following_url":"https://api.github.com/users/EverythingMe/following{/other_user}","gists_url":"https://api.github.com/users/EverythingMe/gists{/gist_id}","starred_url":"https://api.github.com/users/EverythingMe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EverythingMe/subscriptions","organizations_url":"https://api.github.com/users/EverythingMe/orgs","repos_url":"https://api.github.com/users/EverythingMe/repos","events_url":"https://api.github.com/users/EverythingMe/events{/privacy}","received_events_url":"https://api.github.com/users/EverythingMe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EverythingMe/redash","description":"Rethinking how data is queried, shared and visualized. A web application that allows to easily query an existing database, share the dataset and visualize it in different ways. Oh and you can also create dashboards.","fork":false,"url":"https://api.github.com/repos/EverythingMe/redash","forks_url":"https://api.github.com/repos/EverythingMe/redash/forks","keys_url":"https://api.github.com/repos/EverythingMe/redash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EverythingMe/redash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EverythingMe/redash/teams","hooks_url":"https://api.github.com/repos/EverythingMe/redash/hooks","issue_events_url":"https://api.github.com/repos/EverythingMe/redash/issues/events{/number}","events_url":"https://api.github.com/repos/EverythingMe/redash/events","assignees_url":"https://api.github.com/repos/EverythingMe/redash/assignees{/user}","branches_url":"https://api.github.com/repos/EverythingMe/redash/branches{/branch}","tags_url":"https://api.github.com/repos/EverythingMe/redash/tags","blobs_url":"https://api.github.com/repos/EverythingMe/redash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EverythingMe/redash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EverythingMe/redash/git/refs{/sha}","trees_url":"https://api.github.com/repos/EverythingMe/redash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EverythingMe/redash/statuses/{sha}","languages_url":"https://api.github.com/repos/EverythingMe/redash/languages","stargazers_url":"https://api.github.com/repos/EverythingMe/redash/stargazers","contributors_url":"https://api.github.com/repos/EverythingMe/redash/contributors","subscribers_url":"https://api.github.com/repos/EverythingMe/redash/subscribers","subscription_url":"https://api.github.com/repos/EverythingMe/redash/subscription","commits_url":"https://api.github.com/repos/EverythingMe/redash/commits{/sha}","git_commits_url":"https://api.github.com/repos/EverythingMe/redash/git/commits{/sha}","comments_url":"https://api.github.com/repos/EverythingMe/redash/comments{/number}","issue_comment_url":"https://api.github.com/repos/EverythingMe/redash/issues/comments{/number}","contents_url":"https://api.github.com/repos/EverythingMe/redash/contents/{+path}","compare_url":"https://api.github.com/repos/EverythingMe/redash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EverythingMe/redash/merges","archive_url":"https://api.github.com/repos/EverythingMe/redash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EverythingMe/redash/downloads","issues_url":"https://api.github.com/repos/EverythingMe/redash/issues{/number}","pulls_url":"https://api.github.com/repos/EverythingMe/redash/pulls{/number}","milestones_url":"https://api.github.com/repos/EverythingMe/redash/milestones{/number}","notifications_url":"https://api.github.com/repos/EverythingMe/redash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EverythingMe/redash/labels{/name}","releases_url":"https://api.github.com/repos/EverythingMe/redash/releases{/id}","created_at":"2013-10-28T13:19:39Z","updated_at":"2015-07-22T02:44:35Z","pushed_at":"2015-07-22T14:37:06Z","git_url":"git://github.com/EverythingMe/redash.git","ssh_url":"git@github.com:EverythingMe/redash.git","clone_url":"https://github.com/EverythingMe/redash.git","svn_url":"https://github.com/EverythingMe/redash","homepage":"http://redash.io/","size":8223,"stargazers_count":729,"watchers_count":729,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":91,"mirror_url":null,"open_issues_count":68,"forks":91,"open_issues":68,"watchers":729,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EverythingMe/redash/pulls/503"},"html":{"href":"https://github.com/EverythingMe/redash/pull/503"},"issue":{"href":"https://api.github.com/repos/EverythingMe/redash/issues/503"},"comments":{"href":"https://api.github.com/repos/EverythingMe/redash/issues/503/comments"},"review_comments":{"href":"https://api.github.com/repos/EverythingMe/redash/pulls/503/comments"},"review_comment":{"href":"https://api.github.com/repos/EverythingMe/redash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EverythingMe/redash/pulls/503/commits"},"statuses":{"href":"https://api.github.com/repos/EverythingMe/redash/statuses/6a9d95f1ac67ea7b091a35da6ad05766c2740fb6"}}}}