[ 
https://issues.apache.org/jira/browse/BEAM-6693?focusedWorklogId=246459&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-246459
 ]

ASF GitHub Bot logged work on BEAM-6693:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/May/19 23:46
            Start Date: 21/May/19 23:46
    Worklog Time Spent: 10m 
      Work Description: robinyqiu commented on pull request #8535: [BEAM-6693] 
ApproximateUnique transform for Python SDK
URL: https://github.com/apache/beam/pull/8535#discussion_r286265782
 
 

 ##########
 File path: sdks/python/apache_beam/transforms/stats.py
 ##########
 @@ -0,0 +1,215 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""This module has all statistic related transforms."""
+
+from __future__ import absolute_import
+from __future__ import division
+
+import heapq
+import math
+import sys
+from builtins import round
+
+import mmh3
+
+from apache_beam import coders
+from apache_beam.transforms.core import *
+from apache_beam.transforms.ptransform import PTransform
+
+__all__ = [
+    'ApproximateUniqueGlobally',
+    'ApproximateUniquePerKey',
+]
+
+
+class ApproximateUniqueGlobally(PTransform):
 
 Review comment:
   We can add type annotation to the `PTransform`s here using 
`@with_input_type` and `@with_output_type`.
   
   See 
https://github.com/apache/beam/blob/a71f305402efe050c9dcf5ef305141a66efb2953/sdks/python/apache_beam/transforms/core.py#L1788
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 246459)
    Time Spent: 9h 20m  (was: 9h 10m)

> ApproximateUnique transform for Python SDK
> ------------------------------------------
>
>                 Key: BEAM-6693
>                 URL: https://issues.apache.org/jira/browse/BEAM-6693
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-py-core
>            Reporter: Ahmet Altay
>            Assignee: Hannah Jiang
>            Priority: Minor
>          Time Spent: 9h 20m
>  Remaining Estimate: 0h
>
> Add a PTransform for estimating the number of distinct elements in a 
> PCollection and the number of distinct values associated with each key in a 
> PCollection KVs.
> it should offer the same API as its Java counterpart: 
> https://github.com/apache/beam/blob/11a977b8b26eff2274d706541127c19dc93131a2/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ApproximateUnique.java



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to