{"action":"created","comment":{"url":"https://api.github.com/repos/apache/beam/pulls/comments/99240073","pull_request_review_id":19911637,"id":99240073,"diff_hunk":"@@ -324,11 +324,12 @@ def __init__(self, fn):\n       raise TypeError('Expected a callable object instead of: %r' % fn)\n \n     self._fn = fn\n-    if _fn_takes_side_inputs(fn):\n-      self.process = lambda context, *args, **kwargs: fn(\n-          context.element, *args, **kwargs)\n+    if isinstance(fn, (\n+        types.BuiltinFunctionType, types.MethodType, types.FunctionType)):\n+      self.process = fn\n     else:\n-      self.process = lambda context: fn(context.element)\n+      # For cases such as set / list where fn is callable but not a function\n+      self.process = lambda e: fn(e)","path":"sdks/python/apache_beam/transforms/core.py","position":null,"original_position":22,"commit_id":"9ba7897d64c31938cc6e0bb98a7b9dee12f1a5ea","original_commit_id":"1d619ae25a44cea4e366f7e5647680c41cddabc3","user":{"login":"sb2nov","id":1517779,"avatar_url":"https://avatars.githubusercontent.com/u/1517779?v=3","gravatar_id":"","url":"https://api.github.com/users/sb2nov","html_url":"https://github.com/sb2nov","followers_url":"https://api.github.com/users/sb2nov/followers","following_url":"https://api.github.com/users/sb2nov/following{/other_user}","gists_url":"https://api.github.com/users/sb2nov/gists{/gist_id}","starred_url":"https://api.github.com/users/sb2nov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sb2nov/subscriptions","organizations_url":"https://api.github.com/users/sb2nov/orgs","repos_url":"https://api.github.com/users/sb2nov/repos","events_url":"https://api.github.com/users/sb2nov/events{/privacy}","received_events_url":"https://api.github.com/users/sb2nov/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2017-02-02T22:49:33Z","updated_at":"2017-02-02T22:49:33Z","html_url":"https://github.com/apache/beam/pull/1894#discussion_r99240073","pull_request_url":"https://api.github.com/repos/apache/beam/pulls/1894","_links":{"self":{"href":"https://api.github.com/repos/apache/beam/pulls/comments/99240073"},"html":{"href":"https://github.com/apache/beam/pull/1894#discussion_r99240073"},"pull_request":{"href":"https://api.github.com/repos/apache/beam/pulls/1894"}}},"pull_request":{"url":"https://api.github.com/repos/apache/beam/pulls/1894","id":104250274,"html_url":"https://github.com/apache/beam/pull/1894","diff_url":"https://github.com/apache/beam/pull/1894.diff","patch_url":"https://github.com/apache/beam/pull/1894.patch","issue_url":"https://api.github.com/repos/apache/beam/issues/1894","number":1894,"state":"open","locked":false,"title":"[BEAM-886] Migrate CallableWrapperDoFn to use the NewDoFn type","user":{"login":"sb2nov","id":1517779,"avatar_url":"https://avatars.githubusercontent.com/u/1517779?v=3","gravatar_id":"","url":"https://api.github.com/users/sb2nov","html_url":"https://github.com/sb2nov","followers_url":"https://api.github.com/users/sb2nov/followers","following_url":"https://api.github.com/users/sb2nov/following{/other_user}","gists_url":"https://api.github.com/users/sb2nov/gists{/gist_id}","starred_url":"https://api.github.com/users/sb2nov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sb2nov/subscriptions","organizations_url":"https://api.github.com/users/sb2nov/orgs","repos_url":"https://api.github.com/users/sb2nov/repos","events_url":"https://api.github.com/users/sb2nov/events{/privacy}","received_events_url":"https://api.github.com/users/sb2nov/received_events","type":"User","site_admin":false},"body":"R: @aaltay PTAL\r\n\r\nBe sure to do all of the following to help us incorporate your contribution\r\nquickly and easily:\r\n\r\n - [x] Make sure the PR title is formatted like:\r\n   `[BEAM-<Jira issue #>] Description of pull request`\r\n - [x] Make sure tests pass via `mvn clean verify`. (Even better, enable\r\n       Travis-CI on your fork and ensure the whole test matrix passes).\r\n - [x] Replace `<Jira issue #>` in the title with the actual Jira issue\r\n       number, if there is one.\r\n - [ ] If this contribution is large, please file an Apache\r\n       [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.txt).\r\n\r\n---\r\n","created_at":"2017-02-02T00:06:07Z","updated_at":"2017-02-02T22:49:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"370d20730c49cae0c71510752a9e566e8a9b0fbf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/beam/pulls/1894/commits","review_comments_url":"https://api.github.com/repos/apache/beam/pulls/1894/comments","review_comment_url":"https://api.github.com/repos/apache/beam/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/beam/issues/1894/comments","statuses_url":"https://api.github.com/repos/apache/beam/statuses/9ba7897d64c31938cc6e0bb98a7b9dee12f1a5ea","head":{"label":"sb2nov:BEAM-886-Add-NewDoFn-class-2","ref":"BEAM-886-Add-NewDoFn-class-2","sha":"9ba7897d64c31938cc6e0bb98a7b9dee12f1a5ea","user":{"login":"sb2nov","id":1517779,"avatar_url":"https://avatars.githubusercontent.com/u/1517779?v=3","gravatar_id":"","url":"https://api.github.com/users/sb2nov","html_url":"https://github.com/sb2nov","followers_url":"https://api.github.com/users/sb2nov/followers","following_url":"https://api.github.com/users/sb2nov/following{/other_user}","gists_url":"https://api.github.com/users/sb2nov/gists{/gist_id}","starred_url":"https://api.github.com/users/sb2nov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sb2nov/subscriptions","organizations_url":"https://api.github.com/users/sb2nov/orgs","repos_url":"https://api.github.com/users/sb2nov/repos","events_url":"https://api.github.com/users/sb2nov/events{/privacy}","received_events_url":"https://api.github.com/users/sb2nov/received_events","type":"User","site_admin":false},"repo":{"id":70828505,"name":"beam","full_name":"sb2nov/beam","owner":{"login":"sb2nov","id":1517779,"avatar_url":"https://avatars.githubusercontent.com/u/1517779?v=3","gravatar_id":"","url":"https://api.github.com/users/sb2nov","html_url":"https://github.com/sb2nov","followers_url":"https://api.github.com/users/sb2nov/followers","following_url":"https://api.github.com/users/sb2nov/following{/other_user}","gists_url":"https://api.github.com/users/sb2nov/gists{/gist_id}","starred_url":"https://api.github.com/users/sb2nov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sb2nov/subscriptions","organizations_url":"https://api.github.com/users/sb2nov/orgs","repos_url":"https://api.github.com/users/sb2nov/repos","events_url":"https://api.github.com/users/sb2nov/events{/privacy}","received_events_url":"https://api.github.com/users/sb2nov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sb2nov/beam","description":"Mirror of Apache Beam","fork":true,"url":"https://api.github.com/repos/sb2nov/beam","forks_url":"https://api.github.com/repos/sb2nov/beam/forks","keys_url":"https://api.github.com/repos/sb2nov/beam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sb2nov/beam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sb2nov/beam/teams","hooks_url":"https://api.github.com/repos/sb2nov/beam/hooks","issue_events_url":"https://api.github.com/repos/sb2nov/beam/issues/events{/number}","events_url":"https://api.github.com/repos/sb2nov/beam/events","assignees_url":"https://api.github.com/repos/sb2nov/beam/assignees{/user}","branches_url":"https://api.github.com/repos/sb2nov/beam/branches{/branch}","tags_url":"https://api.github.com/repos/sb2nov/beam/tags","blobs_url":"https://api.github.com/repos/sb2nov/beam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sb2nov/beam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sb2nov/beam/git/refs{/sha}","trees_url":"https://api.github.com/repos/sb2nov/beam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sb2nov/beam/statuses/{sha}","languages_url":"https://api.github.com/repos/sb2nov/beam/languages","stargazers_url":"https://api.github.com/repos/sb2nov/beam/stargazers","contributors_url":"https://api.github.com/repos/sb2nov/beam/contributors","subscribers_url":"https://api.github.com/repos/sb2nov/beam/subscribers","subscription_url":"https://api.github.com/repos/sb2nov/beam/subscription","commits_url":"https://api.github.com/repos/sb2nov/beam/commits{/sha}","git_commits_url":"https://api.github.com/repos/sb2nov/beam/git/commits{/sha}","comments_url":"https://api.github.com/repos/sb2nov/beam/comments{/number}","issue_comment_url":"https://api.github.com/repos/sb2nov/beam/issues/comments{/number}","contents_url":"https://api.github.com/repos/sb2nov/beam/contents/{+path}","compare_url":"https://api.github.com/repos/sb2nov/beam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sb2nov/beam/merges","archive_url":"https://api.github.com/repos/sb2nov/beam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sb2nov/beam/downloads","issues_url":"https://api.github.com/repos/sb2nov/beam/issues{/number}","pulls_url":"https://api.github.com/repos/sb2nov/beam/pulls{/number}","milestones_url":"https://api.github.com/repos/sb2nov/beam/milestones{/number}","notifications_url":"https://api.github.com/repos/sb2nov/beam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sb2nov/beam/labels{/name}","releases_url":"https://api.github.com/repos/sb2nov/beam/releases{/id}","deployments_url":"https://api.github.com/repos/sb2nov/beam/deployments","created_at":"2016-10-13T16:58:24Z","updated_at":"2017-02-01T17:46:15Z","pushed_at":"2017-02-02T22:49:19Z","git_url":"git://github.com/sb2nov/beam.git","ssh_url":"git@github.com:sb2nov/beam.git","clone_url":"https://github.com/sb2nov/beam.git","svn_url":"https://github.com/sb2nov/beam","homepage":"","size":27525,"stargazers_count":1,"watchers_count":1,"language":"Java","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":1,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"1a6f2e8f62eddcc3351458eac6e6d9a97f0ec094","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":50904245,"name":"beam","full_name":"apache/beam","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/beam","description":"Mirror of Apache Beam","fork":false,"url":"https://api.github.com/repos/apache/beam","forks_url":"https://api.github.com/repos/apache/beam/forks","keys_url":"https://api.github.com/repos/apache/beam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/beam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/beam/teams","hooks_url":"https://api.github.com/repos/apache/beam/hooks","issue_events_url":"https://api.github.com/repos/apache/beam/issues/events{/number}","events_url":"https://api.github.com/repos/apache/beam/events","assignees_url":"https://api.github.com/repos/apache/beam/assignees{/user}","branches_url":"https://api.github.com/repos/apache/beam/branches{/branch}","tags_url":"https://api.github.com/repos/apache/beam/tags","blobs_url":"https://api.github.com/repos/apache/beam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/beam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/beam/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/beam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/beam/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/beam/languages","stargazers_url":"https://api.github.com/repos/apache/beam/stargazers","contributors_url":"https://api.github.com/repos/apache/beam/contributors","subscribers_url":"https://api.github.com/repos/apache/beam/subscribers","subscription_url":"https://api.github.com/repos/apache/beam/subscription","commits_url":"https://api.github.com/repos/apache/beam/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/beam/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/beam/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/beam/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/beam/contents/{+path}","compare_url":"https://api.github.com/repos/apache/beam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/beam/merges","archive_url":"https://api.github.com/repos/apache/beam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/beam/downloads","issues_url":"https://api.github.com/repos/apache/beam/issues{/number}","pulls_url":"https://api.github.com/repos/apache/beam/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/beam/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/beam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/beam/labels{/name}","releases_url":"https://api.github.com/repos/apache/beam/releases{/id}","deployments_url":"https://api.github.com/repos/apache/beam/deployments","created_at":"2016-02-02T08:00:06Z","updated_at":"2017-02-02T22:42:51Z","pushed_at":"2017-02-02T22:49:20Z","git_url":"git://github.com/apache/beam.git","ssh_url":"git@github.com:apache/beam.git","clone_url":"https://github.com/apache/beam.git","svn_url":"https://github.com/apache/beam","homepage":"","size":27636,"stargazers_count":768,"watchers_count":768,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":423,"mirror_url":"git://git.apache.org/beam.git","open_issues_count":60,"forks":423,"open_issues":60,"watchers":768,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/beam/pulls/1894"},"html":{"href":"https://github.com/apache/beam/pull/1894"},"issue":{"href":"https://api.github.com/repos/apache/beam/issues/1894"},"comments":{"href":"https://api.github.com/repos/apache/beam/issues/1894/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/beam/pulls/1894/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/beam/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/beam/pulls/1894/commits"},"statuses":{"href":"https://api.github.com/repos/apache/beam/statuses/9ba7897d64c31938cc6e0bb98a7b9dee12f1a5ea"}}}}
{"actor":{"display_login":"sb2nov"}}