You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/11/01 16:27:00 UTC

[jira] [Work logged] (BEAM-7389) Colab examples for element-wise transforms (Python)

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

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

                Author: ASF GitHub Bot
            Created on: 01/Nov/19 16:26
            Start Date: 01/Nov/19 16:26
    Worklog Time Spent: 10m 
      Work Description: aaltay commented on pull request #9923: [BEAM-7389] Add code snippets for Count
URL: https://github.com/apache/beam/pull/9923#discussion_r341648886
 
 

 ##########
 File path: sdks/python/apache_beam/examples/snippets/transforms/aggregation/count.py
 ##########
 @@ -0,0 +1,89 @@
+# coding=utf-8
+#
+# 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.
+#
+
+from __future__ import absolute_import
+from __future__ import print_function
+
+
+def count_globally(test=None):
+  # [START count_globally]
+  import apache_beam as beam
+
+  with beam.Pipeline() as pipeline:
+    total_elements = (
+        pipeline
+        | 'Create produce counts' >> beam.Create([
+            ('🥕', 3),
 
 Review comment:
   Should we use something other than integers for values. It almost invite reader to add up the values even though this is not the intended action of count.
   
   A simple change from 1 -> value1 2 -> value2 etc. might clear the confusion.
 
----------------------------------------------------------------
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:
users@infra.apache.org


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

    Worklog Id:     (was: 337396)
    Time Spent: 75h  (was: 74h 50m)

> Colab examples for element-wise transforms (Python)
> ---------------------------------------------------
>
>                 Key: BEAM-7389
>                 URL: https://issues.apache.org/jira/browse/BEAM-7389
>             Project: Beam
>          Issue Type: Improvement
>          Components: website
>            Reporter: Rose Nguyen
>            Assignee: David Cavazos
>            Priority: Minor
>          Time Spent: 75h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)