{"action":"created","comment":{"url":"https://api.github.com/repos/productml/blurr/pulls/comments/181906828","pull_request_review_id":112614261,"id":181906828,"diff_hunk":"@@ -0,0 +1,58 @@\n+from blurr.core.aggregate_block import BlockAggregate, BlockAggregateSchema\n+from blurr.core.evaluation import Expression, EvaluationContext\n+from blurr.core.schema_loader import SchemaLoader\n+from blurr.core.store_key import Key\n+\n+\n+class LabelAggregateSchema(BlockAggregateSchema):\n+    \"\"\"\n+    Data group that handles the block rollup aggregation\n+    \"\"\"\n+\n+    ATTRIBUTE_LABEL = 'Label'\n+\n+    def __init__(self, fully_qualified_name: str, schema_loader: SchemaLoader) -> None:\n+        super().__init__(fully_qualified_name, schema_loader)\n+\n+        # Load type specific attributes\n+        self.label: Expression = Expression(self._spec[self.ATTRIBUTE_LABEL])\n+\n+\n+class LabelAggregate(BlockAggregate):\n+    \"\"\"\n+    Manages the aggregates for block based roll-ups of streaming data\n+    \"\"\"\n+\n+    def __init__(self, schema: LabelAggregateSchema, identity: str,\n+                 evaluation_context: EvaluationContext) -> None:\n+        super().__init__(schema, identity, evaluation_context)\n+        self._label = None\n+\n+    def evaluate(self) -> None:\n+        \"\"\"\n+        Evaluates the current item\n+        \"\"\"\n+\n+        label = self._schema.label.evaluate(self._evaluation_context)\n+\n+        if not self._label:\n+            self._label = label\n+        elif self._label != label:\n+            # Save the current snapshot with the current timestamp\n+            self.persist(self._start_time)\n+            # Reset the state of the contents\n+            self.__init__(self._schema, self._identity, self._evaluation_context)\n+            self._label = label\n+\n+        super().evaluate()\n+\n+    def persist(self, timestamp=None) -> None:","path":"blurr/core/aggregate_label.py","position":49,"original_position":49,"commit_id":"d5cc5955ae35c6864d599129c132a00262e19d8f","original_commit_id":"d5cc5955ae35c6864d599129c132a00262e19d8f","user":{"login":"prashastk","id":33844340,"avatar_url":"https://avatars0.githubusercontent.com/u/33844340?v=4","gravatar_id":"","url":"https://api.github.com/users/prashastk","html_url":"https://github.com/prashastk","followers_url":"https://api.github.com/users/prashastk/followers","following_url":"https://api.github.com/users/prashastk/following{/other_user}","gists_url":"https://api.github.com/users/prashastk/gists{/gist_id}","starred_url":"https://api.github.com/users/prashastk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prashastk/subscriptions","organizations_url":"https://api.github.com/users/prashastk/orgs","repos_url":"https://api.github.com/users/prashastk/repos","events_url":"https://api.github.com/users/prashastk/events{/privacy}","received_events_url":"https://api.github.com/users/prashastk/received_events","type":"User","site_admin":false},"body":"This exists in `Aggregate`. That should be good enough?","created_at":"2018-04-16T22:42:16Z","updated_at":"2018-04-16T22:46:14Z","html_url":"https://github.com/productml/blurr/pull/195#discussion_r181906828","pull_request_url":"https://api.github.com/repos/productml/blurr/pulls/195","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/productml/blurr/pulls/comments/181906828"},"html":{"href":"https://github.com/productml/blurr/pull/195#discussion_r181906828"},"pull_request":{"href":"https://api.github.com/repos/productml/blurr/pulls/195"}}},"pull_request":{"url":"https://api.github.com/repos/productml/blurr/pulls/195","id":181620298,"html_url":"https://github.com/productml/blurr/pull/195","diff_url":"https://github.com/productml/blurr/pull/195.diff","patch_url":"https://github.com/productml/blurr/pull/195.patch","issue_url":"https://api.github.com/repos/productml/blurr/issues/195","number":195,"state":"open","locked":false,"title":"Label Aggregate Implementation","user":{"login":"indradeep","id":405147,"avatar_url":"https://avatars3.githubusercontent.com/u/405147?v=4","gravatar_id":"","url":"https://api.github.com/users/indradeep","html_url":"https://github.com/indradeep","followers_url":"https://api.github.com/users/indradeep/followers","following_url":"https://api.github.com/users/indradeep/following{/other_user}","gists_url":"https://api.github.com/users/indradeep/gists{/gist_id}","starred_url":"https://api.github.com/users/indradeep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indradeep/subscriptions","organizations_url":"https://api.github.com/users/indradeep/orgs","repos_url":"https://api.github.com/users/indradeep/repos","events_url":"https://api.github.com/users/indradeep/events{/privacy}","received_events_url":"https://api.github.com/users/indradeep/received_events","type":"User","site_admin":false},"body":"This is the first stage of the Label aggregate implementation without making the Block Aggregate an abstract base.\r\n\r\nThere may be mild refactoring required when we make the Block Aggregate the abstract base.\r\n","created_at":"2018-04-14T00:22:00Z","updated_at":"2018-04-16T22:46:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cfae39e9ae258aa32b219155975d4ee287ac631b","assignee":{"login":"indradeep","id":405147,"avatar_url":"https://avatars3.githubusercontent.com/u/405147?v=4","gravatar_id":"","url":"https://api.github.com/users/indradeep","html_url":"https://github.com/indradeep","followers_url":"https://api.github.com/users/indradeep/followers","following_url":"https://api.github.com/users/indradeep/following{/other_user}","gists_url":"https://api.github.com/users/indradeep/gists{/gist_id}","starred_url":"https://api.github.com/users/indradeep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indradeep/subscriptions","organizations_url":"https://api.github.com/users/indradeep/orgs","repos_url":"https://api.github.com/users/indradeep/repos","events_url":"https://api.github.com/users/indradeep/events{/privacy}","received_events_url":"https://api.github.com/users/indradeep/received_events","type":"User","site_admin":false},"assignees":[{"login":"indradeep","id":405147,"avatar_url":"https://avatars3.githubusercontent.com/u/405147?v=4","gravatar_id":"","url":"https://api.github.com/users/indradeep","html_url":"https://github.com/indradeep","followers_url":"https://api.github.com/users/indradeep/followers","following_url":"https://api.github.com/users/indradeep/following{/other_user}","gists_url":"https://api.github.com/users/indradeep/gists{/gist_id}","starred_url":"https://api.github.com/users/indradeep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indradeep/subscriptions","organizations_url":"https://api.github.com/users/indradeep/orgs","repos_url":"https://api.github.com/users/indradeep/repos","events_url":"https://api.github.com/users/indradeep/events{/privacy}","received_events_url":"https://api.github.com/users/indradeep/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"mserranom","id":5948929,"avatar_url":"https://avatars3.githubusercontent.com/u/5948929?v=4","gravatar_id":"","url":"https://api.github.com/users/mserranom","html_url":"https://github.com/mserranom","followers_url":"https://api.github.com/users/mserranom/followers","following_url":"https://api.github.com/users/mserranom/following{/other_user}","gists_url":"https://api.github.com/users/mserranom/gists{/gist_id}","starred_url":"https://api.github.com/users/mserranom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mserranom/subscriptions","organizations_url":"https://api.github.com/users/mserranom/orgs","repos_url":"https://api.github.com/users/mserranom/repos","events_url":"https://api.github.com/users/mserranom/events{/privacy}","received_events_url":"https://api.github.com/users/mserranom/received_events","type":"User","site_admin":false},{"login":"vigbk","id":6189632,"avatar_url":"https://avatars1.githubusercontent.com/u/6189632?v=4","gravatar_id":"","url":"https://api.github.com/users/vigbk","html_url":"https://github.com/vigbk","followers_url":"https://api.github.com/users/vigbk/followers","following_url":"https://api.github.com/users/vigbk/following{/other_user}","gists_url":"https://api.github.com/users/vigbk/gists{/gist_id}","starred_url":"https://api.github.com/users/vigbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vigbk/subscriptions","organizations_url":"https://api.github.com/users/vigbk/orgs","repos_url":"https://api.github.com/users/vigbk/repos","events_url":"https://api.github.com/users/vigbk/events{/privacy}","received_events_url":"https://api.github.com/users/vigbk/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/productml/blurr/pulls/195/commits","review_comments_url":"https://api.github.com/repos/productml/blurr/pulls/195/comments","review_comment_url":"https://api.github.com/repos/productml/blurr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/productml/blurr/issues/195/comments","statuses_url":"https://api.github.com/repos/productml/blurr/statuses/d5cc5955ae35c6864d599129c132a00262e19d8f","head":{"label":"productml:label-block-aggregate","ref":"label-block-aggregate","sha":"d5cc5955ae35c6864d599129c132a00262e19d8f","user":{"login":"productml","id":31578582,"avatar_url":"https://avatars2.githubusercontent.com/u/31578582?v=4","gravatar_id":"","url":"https://api.github.com/users/productml","html_url":"https://github.com/productml","followers_url":"https://api.github.com/users/productml/followers","following_url":"https://api.github.com/users/productml/following{/other_user}","gists_url":"https://api.github.com/users/productml/gists{/gist_id}","starred_url":"https://api.github.com/users/productml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/productml/subscriptions","organizations_url":"https://api.github.com/users/productml/orgs","repos_url":"https://api.github.com/users/productml/repos","events_url":"https://api.github.com/users/productml/events{/privacy}","received_events_url":"https://api.github.com/users/productml/received_events","type":"Organization","site_admin":false},"repo":{"id":124137206,"name":"blurr","full_name":"productml/blurr","owner":{"login":"productml","id":31578582,"avatar_url":"https://avatars2.githubusercontent.com/u/31578582?v=4","gravatar_id":"","url":"https://api.github.com/users/productml","html_url":"https://github.com/productml","followers_url":"https://api.github.com/users/productml/followers","following_url":"https://api.github.com/users/productml/following{/other_user}","gists_url":"https://api.github.com/users/productml/gists{/gist_id}","starred_url":"https://api.github.com/users/productml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/productml/subscriptions","organizations_url":"https://api.github.com/users/productml/orgs","repos_url":"https://api.github.com/users/productml/repos","events_url":"https://api.github.com/users/productml/events{/privacy}","received_events_url":"https://api.github.com/users/productml/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/productml/blurr","description":"Domain specific language (DSL) for machine learning feature selection","fork":false,"url":"https://api.github.com/repos/productml/blurr","forks_url":"https://api.github.com/repos/productml/blurr/forks","keys_url":"https://api.github.com/repos/productml/blurr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/productml/blurr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/productml/blurr/teams","hooks_url":"https://api.github.com/repos/productml/blurr/hooks","issue_events_url":"https://api.github.com/repos/productml/blurr/issues/events{/number}","events_url":"https://api.github.com/repos/productml/blurr/events","assignees_url":"https://api.github.com/repos/productml/blurr/assignees{/user}","branches_url":"https://api.github.com/repos/productml/blurr/branches{/branch}","tags_url":"https://api.github.com/repos/productml/blurr/tags","blobs_url":"https://api.github.com/repos/productml/blurr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/productml/blurr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/productml/blurr/git/refs{/sha}","trees_url":"https://api.github.com/repos/productml/blurr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/productml/blurr/statuses/{sha}","languages_url":"https://api.github.com/repos/productml/blurr/languages","stargazers_url":"https://api.github.com/repos/productml/blurr/stargazers","contributors_url":"https://api.github.com/repos/productml/blurr/contributors","subscribers_url":"https://api.github.com/repos/productml/blurr/subscribers","subscription_url":"https://api.github.com/repos/productml/blurr/subscription","commits_url":"https://api.github.com/repos/productml/blurr/commits{/sha}","git_commits_url":"https://api.github.com/repos/productml/blurr/git/commits{/sha}","comments_url":"https://api.github.com/repos/productml/blurr/comments{/number}","issue_comment_url":"https://api.github.com/repos/productml/blurr/issues/comments{/number}","contents_url":"https://api.github.com/repos/productml/blurr/contents/{+path}","compare_url":"https://api.github.com/repos/productml/blurr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/productml/blurr/merges","archive_url":"https://api.github.com/repos/productml/blurr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/productml/blurr/downloads","issues_url":"https://api.github.com/repos/productml/blurr/issues{/number}","pulls_url":"https://api.github.com/repos/productml/blurr/pulls{/number}","milestones_url":"https://api.github.com/repos/productml/blurr/milestones{/number}","notifications_url":"https://api.github.com/repos/productml/blurr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/productml/blurr/labels{/name}","releases_url":"https://api.github.com/repos/productml/blurr/releases{/id}","deployments_url":"https://api.github.com/repos/productml/blurr/deployments","created_at":"2018-03-06T20:53:57Z","updated_at":"2018-04-16T22:27:47Z","pushed_at":"2018-04-16T22:37:07Z","git_url":"git://github.com/productml/blurr.git","ssh_url":"git@github.com:productml/blurr.git","clone_url":"https://github.com/productml/blurr.git","svn_url":"https://github.com/productml/blurr","homepage":"http://blurr.ai","size":1757,"stargazers_count":46,"watchers_count":46,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":48,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":48,"watchers":46,"default_branch":"master"}},"base":{"label":"productml:master","ref":"master","sha":"084deb4ae568dee852cd4203afb793454d5675ad","user":{"login":"productml","id":31578582,"avatar_url":"https://avatars2.githubusercontent.com/u/31578582?v=4","gravatar_id":"","url":"https://api.github.com/users/productml","html_url":"https://github.com/productml","followers_url":"https://api.github.com/users/productml/followers","following_url":"https://api.github.com/users/productml/following{/other_user}","gists_url":"https://api.github.com/users/productml/gists{/gist_id}","starred_url":"https://api.github.com/users/productml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/productml/subscriptions","organizations_url":"https://api.github.com/users/productml/orgs","repos_url":"https://api.github.com/users/productml/repos","events_url":"https://api.github.com/users/productml/events{/privacy}","received_events_url":"https://api.github.com/users/productml/received_events","type":"Organization","site_admin":false},"repo":{"id":124137206,"name":"blurr","full_name":"productml/blurr","owner":{"login":"productml","id":31578582,"avatar_url":"https://avatars2.githubusercontent.com/u/31578582?v=4","gravatar_id":"","url":"https://api.github.com/users/productml","html_url":"https://github.com/productml","followers_url":"https://api.github.com/users/productml/followers","following_url":"https://api.github.com/users/productml/following{/other_user}","gists_url":"https://api.github.com/users/productml/gists{/gist_id}","starred_url":"https://api.github.com/users/productml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/productml/subscriptions","organizations_url":"https://api.github.com/users/productml/orgs","repos_url":"https://api.github.com/users/productml/repos","events_url":"https://api.github.com/users/productml/events{/privacy}","received_events_url":"https://api.github.com/users/productml/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/productml/blurr","description":"Domain specific language (DSL) for machine learning feature selection","fork":false,"url":"https://api.github.com/repos/productml/blurr","forks_url":"https://api.github.com/repos/productml/blurr/forks","keys_url":"https://api.github.com/repos/productml/blurr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/productml/blurr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/productml/blurr/teams","hooks_url":"https://api.github.com/repos/productml/blurr/hooks","issue_events_url":"https://api.github.com/repos/productml/blurr/issues/events{/number}","events_url":"https://api.github.com/repos/productml/blurr/events","assignees_url":"https://api.github.com/repos/productml/blurr/assignees{/user}","branches_url":"https://api.github.com/repos/productml/blurr/branches{/branch}","tags_url":"https://api.github.com/repos/productml/blurr/tags","blobs_url":"https://api.github.com/repos/productml/blurr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/productml/blurr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/productml/blurr/git/refs{/sha}","trees_url":"https://api.github.com/repos/productml/blurr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/productml/blurr/statuses/{sha}","languages_url":"https://api.github.com/repos/productml/blurr/languages","stargazers_url":"https://api.github.com/repos/productml/blurr/stargazers","contributors_url":"https://api.github.com/repos/productml/blurr/contributors","subscribers_url":"https://api.github.com/repos/productml/blurr/subscribers","subscription_url":"https://api.github.com/repos/productml/blurr/subscription","commits_url":"https://api.github.com/repos/productml/blurr/commits{/sha}","git_commits_url":"https://api.github.com/repos/productml/blurr/git/commits{/sha}","comments_url":"https://api.github.com/repos/productml/blurr/comments{/number}","issue_comment_url":"https://api.github.com/repos/productml/blurr/issues/comments{/number}","contents_url":"https://api.github.com/repos/productml/blurr/contents/{+path}","compare_url":"https://api.github.com/repos/productml/blurr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/productml/blurr/merges","archive_url":"https://api.github.com/repos/productml/blurr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/productml/blurr/downloads","issues_url":"https://api.github.com/repos/productml/blurr/issues{/number}","pulls_url":"https://api.github.com/repos/productml/blurr/pulls{/number}","milestones_url":"https://api.github.com/repos/productml/blurr/milestones{/number}","notifications_url":"https://api.github.com/repos/productml/blurr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/productml/blurr/labels{/name}","releases_url":"https://api.github.com/repos/productml/blurr/releases{/id}","deployments_url":"https://api.github.com/repos/productml/blurr/deployments","created_at":"2018-03-06T20:53:57Z","updated_at":"2018-04-16T22:27:47Z","pushed_at":"2018-04-16T22:37:07Z","git_url":"git://github.com/productml/blurr.git","ssh_url":"git@github.com:productml/blurr.git","clone_url":"https://github.com/productml/blurr.git","svn_url":"https://github.com/productml/blurr","homepage":"http://blurr.ai","size":1757,"stargazers_count":46,"watchers_count":46,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":48,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":48,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/productml/blurr/pulls/195"},"html":{"href":"https://github.com/productml/blurr/pull/195"},"issue":{"href":"https://api.github.com/repos/productml/blurr/issues/195"},"comments":{"href":"https://api.github.com/repos/productml/blurr/issues/195/comments"},"review_comments":{"href":"https://api.github.com/repos/productml/blurr/pulls/195/comments"},"review_comment":{"href":"https://api.github.com/repos/productml/blurr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/productml/blurr/pulls/195/commits"},"statuses":{"href":"https://api.github.com/repos/productml/blurr/statuses/d5cc5955ae35c6864d599129c132a00262e19d8f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"prashastk"}}