{"action":"created","comment":{"url":"https://api.github.com/repos/databricks/spark-sklearn/pulls/comments/68430771","id":68430771,"diff_hunk":"@@ -0,0 +1,158 @@\n+\"\"\"\n+Method for applying arbitrary UDFs over grouped data.\n+\"\"\"\n+\n+from distutils.version import LooseVersion\n+from itertools import chain\n+from py4j import java_gateway\n+\n+from pyspark import SparkContext\n+from pyspark.sql import DataFrame, SparkSession\n+from pyspark.sql.functions import explode, udf\n+from pyspark.sql.types import *\n+from pyspark.sql.types import Row\n+\n+\n+def gapply(grouped_data, func, schema, *cols):\n+    \"\"\"WARNING: this function is planned to be migrated to apache/spark for release 2.1. This","path":"python/spark_sklearn/group_apply.py","position":17,"original_position":17,"commit_id":"52fad18554af8ed6ad48d4e4ad649149c78e33b1","original_commit_id":"52fad18554af8ed6ad48d4e4ad649149c78e33b1","user":{"login":"vlad17","id":5834964,"avatar_url":"https://avatars.githubusercontent.com/u/5834964?v=3","gravatar_id":"","url":"https://api.github.com/users/vlad17","html_url":"https://github.com/vlad17","followers_url":"https://api.github.com/users/vlad17/followers","following_url":"https://api.github.com/users/vlad17/following{/other_user}","gists_url":"https://api.github.com/users/vlad17/gists{/gist_id}","starred_url":"https://api.github.com/users/vlad17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlad17/subscriptions","organizations_url":"https://api.github.com/users/vlad17/orgs","repos_url":"https://api.github.com/users/vlad17/repos","events_url":"https://api.github.com/users/vlad17/events{/privacy}","received_events_url":"https://api.github.com/users/vlad17/received_events","type":"User","site_admin":false},"body":"done\r\n","created_at":"2016-06-24T17:22:14Z","updated_at":"2016-06-24T17:22:14Z","html_url":"https://github.com/databricks/spark-sklearn/pull/25#discussion_r68430771","pull_request_url":"https://api.github.com/repos/databricks/spark-sklearn/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/databricks/spark-sklearn/pulls/comments/68430771"},"html":{"href":"https://github.com/databricks/spark-sklearn/pull/25#discussion_r68430771"},"pull_request":{"href":"https://api.github.com/repos/databricks/spark-sklearn/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/databricks/spark-sklearn/pulls/25","id":75039681,"html_url":"https://github.com/databricks/spark-sklearn/pull/25","diff_url":"https://github.com/databricks/spark-sklearn/pull/25.diff","patch_url":"https://github.com/databricks/spark-sklearn/pull/25.patch","issue_url":"https://api.github.com/repos/databricks/spark-sklearn/issues/25","number":25,"state":"open","locked":false,"title":"Add gapply and unit tests","user":{"login":"vlad17","id":5834964,"avatar_url":"https://avatars.githubusercontent.com/u/5834964?v=3","gravatar_id":"","url":"https://api.github.com/users/vlad17","html_url":"https://github.com/vlad17","followers_url":"https://api.github.com/users/vlad17/followers","following_url":"https://api.github.com/users/vlad17/following{/other_user}","gists_url":"https://api.github.com/users/vlad17/gists{/gist_id}","starred_url":"https://api.github.com/users/vlad17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlad17/subscriptions","organizations_url":"https://api.github.com/users/vlad17/orgs","repos_url":"https://api.github.com/users/vlad17/repos","events_url":"https://api.github.com/users/vlad17/events{/privacy}","received_events_url":"https://api.github.com/users/vlad17/received_events","type":"User","site_admin":false},"body":"Gapply is in its own file, with a warning that it's going to move to spark soon. Doctests tested manually.\r\n\r\nChanges to non-gapply things:\r\n1. Perform spark setup in `@fixtureReuseSparkSession` BEFORE calling `setUpClass()` to let classes have access to a spark session.\r\n2. Add `*~` pattern to gitignore. I couldn't deal with cleaning untracked files myself anymore.","created_at":"2016-06-23T22:44:07Z","updated_at":"2016-06-24T17:22:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c3a32b4fae5d8cc4be024ba52ed88ff651c5c96c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/databricks/spark-sklearn/pulls/25/commits","review_comments_url":"https://api.github.com/repos/databricks/spark-sklearn/pulls/25/comments","review_comment_url":"https://api.github.com/repos/databricks/spark-sklearn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/databricks/spark-sklearn/issues/25/comments","statuses_url":"https://api.github.com/repos/databricks/spark-sklearn/statuses/52fad18554af8ed6ad48d4e4ad649149c78e33b1","head":{"label":"vlad17:add-gapply","ref":"add-gapply","sha":"52fad18554af8ed6ad48d4e4ad649149c78e33b1","user":{"login":"vlad17","id":5834964,"avatar_url":"https://avatars.githubusercontent.com/u/5834964?v=3","gravatar_id":"","url":"https://api.github.com/users/vlad17","html_url":"https://github.com/vlad17","followers_url":"https://api.github.com/users/vlad17/followers","following_url":"https://api.github.com/users/vlad17/following{/other_user}","gists_url":"https://api.github.com/users/vlad17/gists{/gist_id}","starred_url":"https://api.github.com/users/vlad17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlad17/subscriptions","organizations_url":"https://api.github.com/users/vlad17/orgs","repos_url":"https://api.github.com/users/vlad17/repos","events_url":"https://api.github.com/users/vlad17/events{/privacy}","received_events_url":"https://api.github.com/users/vlad17/received_events","type":"User","site_admin":false},"repo":{"id":61221264,"name":"spark-sklearn","full_name":"vlad17/spark-sklearn","owner":{"login":"vlad17","id":5834964,"avatar_url":"https://avatars.githubusercontent.com/u/5834964?v=3","gravatar_id":"","url":"https://api.github.com/users/vlad17","html_url":"https://github.com/vlad17","followers_url":"https://api.github.com/users/vlad17/followers","following_url":"https://api.github.com/users/vlad17/following{/other_user}","gists_url":"https://api.github.com/users/vlad17/gists{/gist_id}","starred_url":"https://api.github.com/users/vlad17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlad17/subscriptions","organizations_url":"https://api.github.com/users/vlad17/orgs","repos_url":"https://api.github.com/users/vlad17/repos","events_url":"https://api.github.com/users/vlad17/events{/privacy}","received_events_url":"https://api.github.com/users/vlad17/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vlad17/spark-sklearn","description":"Scikit-learn integration package for Spark","fork":true,"url":"https://api.github.com/repos/vlad17/spark-sklearn","forks_url":"https://api.github.com/repos/vlad17/spark-sklearn/forks","keys_url":"https://api.github.com/repos/vlad17/spark-sklearn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vlad17/spark-sklearn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vlad17/spark-sklearn/teams","hooks_url":"https://api.github.com/repos/vlad17/spark-sklearn/hooks","issue_events_url":"https://api.github.com/repos/vlad17/spark-sklearn/issues/events{/number}","events_url":"https://api.github.com/repos/vlad17/spark-sklearn/events","assignees_url":"https://api.github.com/repos/vlad17/spark-sklearn/assignees{/user}","branches_url":"https://api.github.com/repos/vlad17/spark-sklearn/branches{/branch}","tags_url":"https://api.github.com/repos/vlad17/spark-sklearn/tags","blobs_url":"https://api.github.com/repos/vlad17/spark-sklearn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vlad17/spark-sklearn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vlad17/spark-sklearn/git/refs{/sha}","trees_url":"https://api.github.com/repos/vlad17/spark-sklearn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vlad17/spark-sklearn/statuses/{sha}","languages_url":"https://api.github.com/repos/vlad17/spark-sklearn/languages","stargazers_url":"https://api.github.com/repos/vlad17/spark-sklearn/stargazers","contributors_url":"https://api.github.com/repos/vlad17/spark-sklearn/contributors","subscribers_url":"https://api.github.com/repos/vlad17/spark-sklearn/subscribers","subscription_url":"https://api.github.com/repos/vlad17/spark-sklearn/subscription","commits_url":"https://api.github.com/repos/vlad17/spark-sklearn/commits{/sha}","git_commits_url":"https://api.github.com/repos/vlad17/spark-sklearn/git/commits{/sha}","comments_url":"https://api.github.com/repos/vlad17/spark-sklearn/comments{/number}","issue_comment_url":"https://api.github.com/repos/vlad17/spark-sklearn/issues/comments{/number}","contents_url":"https://api.github.com/repos/vlad17/spark-sklearn/contents/{+path}","compare_url":"https://api.github.com/repos/vlad17/spark-sklearn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vlad17/spark-sklearn/merges","archive_url":"https://api.github.com/repos/vlad17/spark-sklearn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vlad17/spark-sklearn/downloads","issues_url":"https://api.github.com/repos/vlad17/spark-sklearn/issues{/number}","pulls_url":"https://api.github.com/repos/vlad17/spark-sklearn/pulls{/number}","milestones_url":"https://api.github.com/repos/vlad17/spark-sklearn/milestones{/number}","notifications_url":"https://api.github.com/repos/vlad17/spark-sklearn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vlad17/spark-sklearn/labels{/name}","releases_url":"https://api.github.com/repos/vlad17/spark-sklearn/releases{/id}","deployments_url":"https://api.github.com/repos/vlad17/spark-sklearn/deployments","created_at":"2016-06-15T16:00:20Z","updated_at":"2016-06-15T16:00:21Z","pushed_at":"2016-06-24T00:49:54Z","git_url":"git://github.com/vlad17/spark-sklearn.git","ssh_url":"git@github.com:vlad17/spark-sklearn.git","clone_url":"https://github.com/vlad17/spark-sklearn.git","svn_url":"https://github.com/vlad17/spark-sklearn","homepage":"","size":371,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"databricks:master","ref":"master","sha":"a1f027263e19fb9d17afc142c9bbb7d06da5c380","user":{"login":"databricks","id":4998052,"avatar_url":"https://avatars.githubusercontent.com/u/4998052?v=3","gravatar_id":"","url":"https://api.github.com/users/databricks","html_url":"https://github.com/databricks","followers_url":"https://api.github.com/users/databricks/followers","following_url":"https://api.github.com/users/databricks/following{/other_user}","gists_url":"https://api.github.com/users/databricks/gists{/gist_id}","starred_url":"https://api.github.com/users/databricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/databricks/subscriptions","organizations_url":"https://api.github.com/users/databricks/orgs","repos_url":"https://api.github.com/users/databricks/repos","events_url":"https://api.github.com/users/databricks/events{/privacy}","received_events_url":"https://api.github.com/users/databricks/received_events","type":"Organization","site_admin":false},"repo":{"id":41820544,"name":"spark-sklearn","full_name":"databricks/spark-sklearn","owner":{"login":"databricks","id":4998052,"avatar_url":"https://avatars.githubusercontent.com/u/4998052?v=3","gravatar_id":"","url":"https://api.github.com/users/databricks","html_url":"https://github.com/databricks","followers_url":"https://api.github.com/users/databricks/followers","following_url":"https://api.github.com/users/databricks/following{/other_user}","gists_url":"https://api.github.com/users/databricks/gists{/gist_id}","starred_url":"https://api.github.com/users/databricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/databricks/subscriptions","organizations_url":"https://api.github.com/users/databricks/orgs","repos_url":"https://api.github.com/users/databricks/repos","events_url":"https://api.github.com/users/databricks/events{/privacy}","received_events_url":"https://api.github.com/users/databricks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/databricks/spark-sklearn","description":"Scikit-learn integration package for Spark","fork":false,"url":"https://api.github.com/repos/databricks/spark-sklearn","forks_url":"https://api.github.com/repos/databricks/spark-sklearn/forks","keys_url":"https://api.github.com/repos/databricks/spark-sklearn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/databricks/spark-sklearn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/databricks/spark-sklearn/teams","hooks_url":"https://api.github.com/repos/databricks/spark-sklearn/hooks","issue_events_url":"https://api.github.com/repos/databricks/spark-sklearn/issues/events{/number}","events_url":"https://api.github.com/repos/databricks/spark-sklearn/events","assignees_url":"https://api.github.com/repos/databricks/spark-sklearn/assignees{/user}","branches_url":"https://api.github.com/repos/databricks/spark-sklearn/branches{/branch}","tags_url":"https://api.github.com/repos/databricks/spark-sklearn/tags","blobs_url":"https://api.github.com/repos/databricks/spark-sklearn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/databricks/spark-sklearn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/databricks/spark-sklearn/git/refs{/sha}","trees_url":"https://api.github.com/repos/databricks/spark-sklearn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/databricks/spark-sklearn/statuses/{sha}","languages_url":"https://api.github.com/repos/databricks/spark-sklearn/languages","stargazers_url":"https://api.github.com/repos/databricks/spark-sklearn/stargazers","contributors_url":"https://api.github.com/repos/databricks/spark-sklearn/contributors","subscribers_url":"https://api.github.com/repos/databricks/spark-sklearn/subscribers","subscription_url":"https://api.github.com/repos/databricks/spark-sklearn/subscription","commits_url":"https://api.github.com/repos/databricks/spark-sklearn/commits{/sha}","git_commits_url":"https://api.github.com/repos/databricks/spark-sklearn/git/commits{/sha}","comments_url":"https://api.github.com/repos/databricks/spark-sklearn/comments{/number}","issue_comment_url":"https://api.github.com/repos/databricks/spark-sklearn/issues/comments{/number}","contents_url":"https://api.github.com/repos/databricks/spark-sklearn/contents/{+path}","compare_url":"https://api.github.com/repos/databricks/spark-sklearn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/databricks/spark-sklearn/merges","archive_url":"https://api.github.com/repos/databricks/spark-sklearn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/databricks/spark-sklearn/downloads","issues_url":"https://api.github.com/repos/databricks/spark-sklearn/issues{/number}","pulls_url":"https://api.github.com/repos/databricks/spark-sklearn/pulls{/number}","milestones_url":"https://api.github.com/repos/databricks/spark-sklearn/milestones{/number}","notifications_url":"https://api.github.com/repos/databricks/spark-sklearn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/databricks/spark-sklearn/labels{/name}","releases_url":"https://api.github.com/repos/databricks/spark-sklearn/releases{/id}","deployments_url":"https://api.github.com/repos/databricks/spark-sklearn/deployments","created_at":"2015-09-02T18:44:51Z","updated_at":"2016-06-24T05:31:11Z","pushed_at":"2016-06-24T00:15:58Z","git_url":"git://github.com/databricks/spark-sklearn.git","ssh_url":"git@github.com:databricks/spark-sklearn.git","clone_url":"https://github.com/databricks/spark-sklearn.git","svn_url":"https://github.com/databricks/spark-sklearn","homepage":"","size":235,"stargazers_count":169,"watchers_count":169,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":4,"forks":35,"open_issues":4,"watchers":169,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/databricks/spark-sklearn/pulls/25"},"html":{"href":"https://github.com/databricks/spark-sklearn/pull/25"},"issue":{"href":"https://api.github.com/repos/databricks/spark-sklearn/issues/25"},"comments":{"href":"https://api.github.com/repos/databricks/spark-sklearn/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/databricks/spark-sklearn/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/databricks/spark-sklearn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/databricks/spark-sklearn/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/databricks/spark-sklearn/statuses/52fad18554af8ed6ad48d4e4ad649149c78e33b1"}}}}
{"actor":{"display_login":"vlad17"}}