{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments/47870961","id":47870961,"diff_hunk":"@@ -31,3 +32,111 @@ class Row(object):\n     def __init__(self, row_key, table):\n         self._row_key = _to_bytes(row_key)\n         self._table = table\n+\n+\n+class RowFilter(object):\n+    \"\"\"Basic filter to apply to cells in a row.\n+\n+    These values can be combined via :class:`RowFilterChain`,\n+    :class:`RowFilterUnion` and :class:`ConditionalRowFilter`.\n+\n+    .. note::\n+\n+        This class is a do-nothing base class for all row filters.\n+    \"\"\"\n+\n+    def to_pb(self):\n+        \"\"\"Converts the :class:`RowFilter` to a protobuf.\n+\n+        :raises: :class:`NotImplementedError <exceptions.NotImplementedError>`\n+                 always since a virtual class.\n+        \"\"\"\n+        raise NotImplementedError\n+\n+    def __ne__(self, other):\n+        return not self.__eq__(other)\n+\n+\n+class _RegexFilter(RowFilter):\n+    \"\"\"Row filter that uses a regular expression.\n+\n+    The ``regex`` must be valid RE2 patterns. See Google's\n+    `RE2 reference`_ for the accepted syntax.\n+\n+    .. _RE2 reference: https://github.com/google/re2/wiki/Syntax\n+\n+    :type regex: bytes or str\n+    :param regex: A regular expression (RE2) for some row filter.\n+    \"\"\"\n+\n+    def __init__(self, regex):\n+        self.regex = regex\n+\n+    def __eq__(self, other):\n+        if not isinstance(other, self.__class__):\n+            return False\n+        return other.regex == self.regex\n+\n+    def to_pb(self):","path":"gcloud/bigtable/row.py","position":57,"original_position":57,"commit_id":"e1fe6a44d1527b052ff2c3449630096e5aafa5f9","original_commit_id":"e1fe6a44d1527b052ff2c3449630096e5aafa5f9","user":{"login":"tseaver","id":242750,"avatar_url":"https://avatars.githubusercontent.com/u/242750?v=3","gravatar_id":"","url":"https://api.github.com/users/tseaver","html_url":"https://github.com/tseaver","followers_url":"https://api.github.com/users/tseaver/followers","following_url":"https://api.github.com/users/tseaver/following{/other_user}","gists_url":"https://api.github.com/users/tseaver/gists{/gist_id}","starred_url":"https://api.github.com/users/tseaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tseaver/subscriptions","organizations_url":"https://api.github.com/users/tseaver/orgs","repos_url":"https://api.github.com/users/tseaver/repos","events_url":"https://api.github.com/users/tseaver/events{/privacy}","received_events_url":"https://api.github.com/users/tseaver/received_events","type":"User","site_admin":false},"body":"+1 to dropping it in both places.","created_at":"2015-12-17T05:32:42Z","updated_at":"2015-12-17T05:32:42Z","html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/1291#discussion_r47870961","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1291","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments/47870961"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/1291#discussion_r47870961"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1291"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1291","id":53867431,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/1291","diff_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/1291.diff","patch_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/1291.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/1291","number":1291,"state":"open","locked":false,"title":"Adding Bigtable RowFilter base class.","user":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"body":"Also adding regex filters for a row key (bytes) and a family name (string).\r\n\r\nThese come from\r\n\r\nhttps://github.com/GoogleCloudPlatform/cloud-bigtable-client/blob/6a498cd3e660c7ed18299e980c1658d67661e69b/bigtable-protos/src/main/proto/google/bigtable/v1/bigtable_data.proto#L321-L404\r\n\r\nIn addition to more classes for primitive properties, parent classes are forthcoming to handle the non-primitive cases of filter Chain, Interleave and Condition (ternary).\r\n\r\nAlso renaming some redunant unit test names in `test_column_family.py`.","created_at":"2015-12-16T16:51:43Z","updated_at":"2015-12-17T05:32:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a9f572662348820bffc7af5b8eb28f8924cdc84","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1291/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1291/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/1291/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/statuses/e1fe6a44d1527b052ff2c3449630096e5aafa5f9","head":{"label":"dhermes:bigtable-row-filter","ref":"bigtable-row-filter","sha":"e1fe6a44d1527b052ff2c3449630096e5aafa5f9","user":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"repo":{"id":23001795,"name":"gcloud-python","full_name":"dhermes/gcloud-python","owner":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dhermes/gcloud-python","description":"Google Cloud Python Client Library","fork":true,"url":"https://api.github.com/repos/dhermes/gcloud-python","forks_url":"https://api.github.com/repos/dhermes/gcloud-python/forks","keys_url":"https://api.github.com/repos/dhermes/gcloud-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dhermes/gcloud-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dhermes/gcloud-python/teams","hooks_url":"https://api.github.com/repos/dhermes/gcloud-python/hooks","issue_events_url":"https://api.github.com/repos/dhermes/gcloud-python/issues/events{/number}","events_url":"https://api.github.com/repos/dhermes/gcloud-python/events","assignees_url":"https://api.github.com/repos/dhermes/gcloud-python/assignees{/user}","branches_url":"https://api.github.com/repos/dhermes/gcloud-python/branches{/branch}","tags_url":"https://api.github.com/repos/dhermes/gcloud-python/tags","blobs_url":"https://api.github.com/repos/dhermes/gcloud-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dhermes/gcloud-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dhermes/gcloud-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/dhermes/gcloud-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dhermes/gcloud-python/statuses/{sha}","languages_url":"https://api.github.com/repos/dhermes/gcloud-python/languages","stargazers_url":"https://api.github.com/repos/dhermes/gcloud-python/stargazers","contributors_url":"https://api.github.com/repos/dhermes/gcloud-python/contributors","subscribers_url":"https://api.github.com/repos/dhermes/gcloud-python/subscribers","subscription_url":"https://api.github.com/repos/dhermes/gcloud-python/subscription","commits_url":"https://api.github.com/repos/dhermes/gcloud-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/dhermes/gcloud-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/dhermes/gcloud-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/dhermes/gcloud-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/dhermes/gcloud-python/contents/{+path}","compare_url":"https://api.github.com/repos/dhermes/gcloud-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dhermes/gcloud-python/merges","archive_url":"https://api.github.com/repos/dhermes/gcloud-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dhermes/gcloud-python/downloads","issues_url":"https://api.github.com/repos/dhermes/gcloud-python/issues{/number}","pulls_url":"https://api.github.com/repos/dhermes/gcloud-python/pulls{/number}","milestones_url":"https://api.github.com/repos/dhermes/gcloud-python/milestones{/number}","notifications_url":"https://api.github.com/repos/dhermes/gcloud-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dhermes/gcloud-python/labels{/name}","releases_url":"https://api.github.com/repos/dhermes/gcloud-python/releases{/id}","created_at":"2014-08-15T20:18:30Z","updated_at":"2015-05-07T17:34:12Z","pushed_at":"2015-12-17T05:24:40Z","git_url":"git://github.com/dhermes/gcloud-python.git","ssh_url":"git@github.com:dhermes/gcloud-python.git","clone_url":"https://github.com/dhermes/gcloud-python.git","svn_url":"https://github.com/dhermes/gcloud-python","homepage":"http://googlecloudplatform.github.io/gcloud-python/","size":9193,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"GoogleCloudPlatform:master","ref":"master","sha":"977b7f85ee82bcd37772f35b9c59070ed9f799d9","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":16316451,"name":"gcloud-python","full_name":"GoogleCloudPlatform/gcloud-python","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-python","description":"Google Cloud Client Library for Python","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/releases{/id}","created_at":"2014-01-28T15:51:47Z","updated_at":"2015-12-16T18:43:59Z","pushed_at":"2015-12-17T05:24:40Z","git_url":"git://github.com/GoogleCloudPlatform/gcloud-python.git","ssh_url":"git@github.com:GoogleCloudPlatform/gcloud-python.git","clone_url":"https://github.com/GoogleCloudPlatform/gcloud-python.git","svn_url":"https://github.com/GoogleCloudPlatform/gcloud-python","homepage":"https://googlecloudplatform.github.io/gcloud-python/","size":41263,"stargazers_count":223,"watchers_count":223,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":123,"mirror_url":null,"open_issues_count":118,"forks":123,"open_issues":118,"watchers":223,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1291"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/1291"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/1291"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/1291/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1291/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1291/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/statuses/e1fe6a44d1527b052ff2c3449630096e5aafa5f9"}}}}