[
https://issues.apache.org/jira/browse/BEAM-7390?focusedWorklogId=354902&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-354902
]
ASF GitHub Bot logged work on BEAM-7390:
----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Dec/19 03:02
Start Date: 06/Dec/19 03:02
Worklog Time Spent: 10m
Work Description: aaltay commented on pull request #10166: [BEAM-7390]
Add code snippet for Latest
URL: https://github.com/apache/beam/pull/10166#discussion_r354647568
##########
File path:
sdks/python/apache_beam/examples/snippets/transforms/aggregation/latest.py
##########
@@ -0,0 +1,69 @@
+# 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 latest_globally(test=None):
+ # [START latest_globally]
+ import apache_beam as beam
+
+ with beam.Pipeline() as pipeline:
+ latest_element = (
+ pipeline
+ | 'Create produce' >> beam.Create([
Review comment:
Latest works by picking the Latest based on the timestamp. I do not recall
with Create does but it may use the same timestamp for its elements, or
potentially an implementation could do that. Perhaps it would be more explicit
to use elements with Timestamps, otherwise the output could be arbitrary.
----------------------------------------------------------------
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: 354902)
Time Spent: 6h 50m (was: 6h 40m)
> Colab examples for aggregation transforms (Python)
> --------------------------------------------------
>
> Key: BEAM-7390
> URL: https://issues.apache.org/jira/browse/BEAM-7390
> Project: Beam
> Issue Type: Improvement
> Components: website
> Reporter: Rose Nguyen
> Assignee: David Cavazos
> Priority: Minor
> Time Spent: 6h 50m
> Remaining Estimate: 0h
>
> Merge aggregation Colabs into the transform catalog
--
This message was sent by Atlassian Jira
(v8.3.4#803005)