Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B6D52200C10 for ; Thu, 19 Jan 2017 22:26:23 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B59D7160B59; Thu, 19 Jan 2017 21:26:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 10470160B54 for ; Thu, 19 Jan 2017 22:26:22 +0100 (CET) Received: (qmail 25672 invoked by uid 500); 19 Jan 2017 21:26:22 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 25552 invoked by uid 99); 19 Jan 2017 21:26:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jan 2017 21:26:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1ADE9F4032; Thu, 19 Jan 2017 21:26:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: robertwb@apache.org To: commits@beam.apache.org Date: Thu, 19 Jan 2017 21:26:23 -0000 Message-Id: <18f10e4e79c54638b2c05ee3fb931aee@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/4] beam git commit: update labels in iobase archived-at: Thu, 19 Jan 2017 21:26:23 -0000 update labels in iobase Project: http://git-wip-us.apache.org/repos/asf/beam/repo Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/0db60e40 Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/0db60e40 Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/0db60e40 Branch: refs/heads/python-sdk Commit: 0db60e40dc5a1e1983504e4535eab0140eb97c0e Parents: 03e18f0 Author: Ahmet Altay Authored: Wed Jan 18 18:06:10 2017 -0800 Committer: Ahmet Altay Committed: Wed Jan 18 18:06:10 2017 -0800 ---------------------------------------------------------------------- sdks/python/apache_beam/io/iobase.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/beam/blob/0db60e40/sdks/python/apache_beam/io/iobase.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/io/iobase.py b/sdks/python/apache_beam/io/iobase.py index 8fb5238..93421a6 100644 --- a/sdks/python/apache_beam/io/iobase.py +++ b/sdks/python/apache_beam/io/iobase.py @@ -748,8 +748,8 @@ class WriteImpl(ptransform.PTransform): def expand(self, pcoll): do_once = pcoll.pipeline | 'DoOnce' >> core.Create([None]) - init_result_coll = do_once | core.Map( - 'initialize_write', lambda _, sink: sink.initialize_write(), self.sink) + init_result_coll = do_once | 'initialize_write' >> core.Map( + lambda _, sink: sink.initialize_write(), self.sink) if getattr(self.sink, 'num_shards', 0): min_shards = self.sink.num_shards if min_shards == 1: @@ -759,18 +759,20 @@ class WriteImpl(ptransform.PTransform): write_result_coll = (keyed_pcoll | core.WindowInto(window.GlobalWindows()) | core.GroupByKey() - | core.Map('write_bundles', - _write_keyed_bundle, self.sink, - AsSingleton(init_result_coll))) + | 'write_bundles' >> core.Map( + _write_keyed_bundle, self.sink, + AsSingleton(init_result_coll))) else: min_shards = 1 - write_result_coll = (pcoll | core.ParDo('write_bundles', - _WriteBundleDoFn(), self.sink, - AsSingleton(init_result_coll)) - | core.Map('pair', lambda x: (None, x)) + write_result_coll = (pcoll + | 'write_bundles' >> + core.ParDo( + _WriteBundleDoFn(), self.sink, + AsSingleton(init_result_coll)) + | 'pair' >> core.Map(lambda x: (None, x)) | core.WindowInto(window.GlobalWindows()) | core.GroupByKey() - | core.FlatMap('extract', lambda x: x[1])) + | 'extract' >> core.FlatMap(lambda x: x[1])) return do_once | core.FlatMap( 'finalize_write', _finalize_write,