{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/75642520","id":75642520,"diff_hunk":"@@ -280,7 +279,7 @@ def extract_code_globals(co):\n         # see if nested function have any global refs\n         if co.co_consts:\n             for const in co.co_consts:\n-                if type(const) is types.CodeType:\n+                if isinstance(const, types.CodeType):","path":"python/pyspark/cloudpickle.py","position":13,"original_position":13,"commit_id":"015028f6647c13bcd589133b70b79049b0a479aa","original_commit_id":"015028f6647c13bcd589133b70b79049b0a479aa","user":{"login":"Stibbons","id":133498,"avatar_url":"https://avatars.githubusercontent.com/u/133498?v=3","gravatar_id":"","url":"https://api.github.com/users/Stibbons","html_url":"https://github.com/Stibbons","followers_url":"https://api.github.com/users/Stibbons/followers","following_url":"https://api.github.com/users/Stibbons/following{/other_user}","gists_url":"https://api.github.com/users/Stibbons/gists{/gist_id}","starred_url":"https://api.github.com/users/Stibbons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stibbons/subscriptions","organizations_url":"https://api.github.com/users/Stibbons/orgs","repos_url":"https://api.github.com/users/Stibbons/repos","events_url":"https://api.github.com/users/Stibbons/events{/privacy}","received_events_url":"https://api.github.com/users/Stibbons/received_events","type":"User","site_admin":false},"body":"this is quite a big error, is it enough to fix it here?","created_at":"2016-08-22T09:12:06Z","updated_at":"2016-08-22T09:12:07Z","html_url":"https://github.com/apache/spark/pull/14567#discussion_r75642520","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/14567","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/75642520"},"html":{"href":"https://github.com/apache/spark/pull/14567#discussion_r75642520"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/14567"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/14567","id":80654562,"html_url":"https://github.com/apache/spark/pull/14567","diff_url":"https://github.com/apache/spark/pull/14567.diff","patch_url":"https://github.com/apache/spark/pull/14567.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/14567","number":14567,"state":"open","locked":false,"title":"[SPARK-16992][PYSPARK] Python Pep8 formatting and import reorganisation","user":{"login":"Stibbons","id":133498,"avatar_url":"https://avatars.githubusercontent.com/u/133498?v=3","gravatar_id":"","url":"https://api.github.com/users/Stibbons","html_url":"https://github.com/Stibbons","followers_url":"https://api.github.com/users/Stibbons/followers","following_url":"https://api.github.com/users/Stibbons/following{/other_user}","gists_url":"https://api.github.com/users/Stibbons/gists{/gist_id}","starred_url":"https://api.github.com/users/Stibbons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stibbons/subscriptions","organizations_url":"https://api.github.com/users/Stibbons/orgs","repos_url":"https://api.github.com/users/Stibbons/repos","events_url":"https://api.github.com/users/Stibbons/events{/privacy}","received_events_url":"https://api.github.com/users/Stibbons/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nThis patch adds a code style validation script following pep8 recommendations.\r\n\r\nFeatures:\r\n- add a .editconfig file (Scala files use 2 space indentation, while Python uses 4) for compatible editors (almost every editors has a plugin to support .editconfig file)\r\n- use autopep8 to fix basic pep8 mistakes\r\n- use isort to automatically split \"import\" statement and organise them into logically linked order (see doc [here](https://pypi.python.org/pypi/isort#multi-line-output-modes). The most important thing is that it split import statements that imports more than one object into several lines. This will increase the number of line of the file, but this facilitates a lot file maintainance and file merges if needed.\r\n- add a 'validate.sh' script in order to automatise the correction (need isort and autopep8 installed)\r\n\r\nYou can see similar script in prod in the [Buildbot](https://github.com/buildbot/buildbot/blob/master/common/validate.sh) project\r\n\r\n\r\n## How was this patch tested?\r\n\r\nSimple tests on my machines has been done (local mode only). There should not have any regression or feature change at all with this pull request.\r\n\r\n","created_at":"2016-08-09T16:44:27Z","updated_at":"2016-08-22T09:12:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1612254bf35f1103b26cde113be7d24206489dcf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/14567/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/14567/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/14567/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/015028f6647c13bcd589133b70b79049b0a479aa","head":{"label":"Stibbons:python_import_reorg","ref":"python_import_reorg","sha":"015028f6647c13bcd589133b70b79049b0a479aa","user":{"login":"Stibbons","id":133498,"avatar_url":"https://avatars.githubusercontent.com/u/133498?v=3","gravatar_id":"","url":"https://api.github.com/users/Stibbons","html_url":"https://github.com/Stibbons","followers_url":"https://api.github.com/users/Stibbons/followers","following_url":"https://api.github.com/users/Stibbons/following{/other_user}","gists_url":"https://api.github.com/users/Stibbons/gists{/gist_id}","starred_url":"https://api.github.com/users/Stibbons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stibbons/subscriptions","organizations_url":"https://api.github.com/users/Stibbons/orgs","repos_url":"https://api.github.com/users/Stibbons/repos","events_url":"https://api.github.com/users/Stibbons/events{/privacy}","received_events_url":"https://api.github.com/users/Stibbons/received_events","type":"User","site_admin":false},"repo":{"id":62233595,"name":"spark","full_name":"Stibbons/spark","owner":{"login":"Stibbons","id":133498,"avatar_url":"https://avatars.githubusercontent.com/u/133498?v=3","gravatar_id":"","url":"https://api.github.com/users/Stibbons","html_url":"https://github.com/Stibbons","followers_url":"https://api.github.com/users/Stibbons/followers","following_url":"https://api.github.com/users/Stibbons/following{/other_user}","gists_url":"https://api.github.com/users/Stibbons/gists{/gist_id}","starred_url":"https://api.github.com/users/Stibbons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stibbons/subscriptions","organizations_url":"https://api.github.com/users/Stibbons/orgs","repos_url":"https://api.github.com/users/Stibbons/repos","events_url":"https://api.github.com/users/Stibbons/events{/privacy}","received_events_url":"https://api.github.com/users/Stibbons/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Stibbons/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/Stibbons/spark","forks_url":"https://api.github.com/repos/Stibbons/spark/forks","keys_url":"https://api.github.com/repos/Stibbons/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Stibbons/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Stibbons/spark/teams","hooks_url":"https://api.github.com/repos/Stibbons/spark/hooks","issue_events_url":"https://api.github.com/repos/Stibbons/spark/issues/events{/number}","events_url":"https://api.github.com/repos/Stibbons/spark/events","assignees_url":"https://api.github.com/repos/Stibbons/spark/assignees{/user}","branches_url":"https://api.github.com/repos/Stibbons/spark/branches{/branch}","tags_url":"https://api.github.com/repos/Stibbons/spark/tags","blobs_url":"https://api.github.com/repos/Stibbons/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Stibbons/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Stibbons/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/Stibbons/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Stibbons/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/Stibbons/spark/languages","stargazers_url":"https://api.github.com/repos/Stibbons/spark/stargazers","contributors_url":"https://api.github.com/repos/Stibbons/spark/contributors","subscribers_url":"https://api.github.com/repos/Stibbons/spark/subscribers","subscription_url":"https://api.github.com/repos/Stibbons/spark/subscription","commits_url":"https://api.github.com/repos/Stibbons/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/Stibbons/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/Stibbons/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/Stibbons/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/Stibbons/spark/contents/{+path}","compare_url":"https://api.github.com/repos/Stibbons/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Stibbons/spark/merges","archive_url":"https://api.github.com/repos/Stibbons/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Stibbons/spark/downloads","issues_url":"https://api.github.com/repos/Stibbons/spark/issues{/number}","pulls_url":"https://api.github.com/repos/Stibbons/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/Stibbons/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/Stibbons/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Stibbons/spark/labels{/name}","releases_url":"https://api.github.com/repos/Stibbons/spark/releases{/id}","deployments_url":"https://api.github.com/repos/Stibbons/spark/deployments","created_at":"2016-06-29T14:46:02Z","updated_at":"2016-06-29T14:46:26Z","pushed_at":"2016-08-22T09:11:15Z","git_url":"git://github.com/Stibbons/spark.git","ssh_url":"git@github.com:Stibbons/spark.git","clone_url":"https://github.com/Stibbons/spark.git","svn_url":"https://github.com/Stibbons/spark","homepage":null,"size":172256,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"apache:master","ref":"master","sha":"bd9655063bdba8836b4ec96ed115e5653e246b65","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2016-08-22T08:38:07Z","pushed_at":"2016-08-22T09:10:52Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":510324,"stargazers_count":9732,"watchers_count":9732,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9075,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":476,"forks":9075,"open_issues":476,"watchers":9732,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/14567"},"html":{"href":"https://github.com/apache/spark/pull/14567"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/14567"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/14567/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/14567/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/14567/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/015028f6647c13bcd589133b70b79049b0a479aa"}}}}
{"actor":{"display_login":"Stibbons"}}