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 25A03200B4A for ; Wed, 20 Jul 2016 22:06:53 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2447B160A8B; Wed, 20 Jul 2016 20:06:53 +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 78C59160A5B for ; Wed, 20 Jul 2016 22:06:52 +0200 (CEST) Received: (qmail 50779 invoked by uid 500); 20 Jul 2016 20:06:51 -0000 Mailing-List: contact commits-help@beam.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.incubator.apache.org Delivered-To: mailing list commits@beam.incubator.apache.org Received: (qmail 50767 invoked by uid 99); 20 Jul 2016 20:06:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jul 2016 20:06:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E1701185886 for ; Wed, 20 Jul 2016 20:06:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id z5gZIBOHozFT for ; Wed, 20 Jul 2016 20:06:49 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with SMTP id 151FD60CF9 for ; Wed, 20 Jul 2016 20:06:47 +0000 (UTC) Received: (qmail 50759 invoked by uid 99); 20 Jul 2016 20:06:47 -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; Wed, 20 Jul 2016 20:06:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 29B43E184E; Wed, 20 Jul 2016 20:06:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: robertwb@apache.org To: commits@beam.incubator.apache.org Date: Wed, 20 Jul 2016 20:06:50 -0000 Message-Id: <191f0928f4724a99adae69e3b69d8026@git.apache.org> In-Reply-To: <5114d38f70e748b187b650f8bf36d895@git.apache.org> References: <5114d38f70e748b187b650f8bf36d895@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/5] incubator-beam git commit: Clarifying comments. archived-at: Wed, 20 Jul 2016 20:06:53 -0000 Clarifying comments. Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/9d1fc85d Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/9d1fc85d Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/9d1fc85d Branch: refs/heads/python-sdk Commit: 9d1fc85d5352f16ce8f0f092865decc6b296dbb8 Parents: 2768981 Author: Robert Bradshaw Authored: Wed Jul 20 12:24:18 2016 -0700 Committer: Robert Bradshaw Committed: Wed Jul 20 13:06:21 2016 -0700 ---------------------------------------------------------------------- sdks/python/apache_beam/runners/common.py | 1 + sdks/python/apache_beam/utils/windowed_value.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/9d1fc85d/sdks/python/apache_beam/runners/common.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/runners/common.py b/sdks/python/apache_beam/runners/common.py index 059359c..ef28c63 100644 --- a/sdks/python/apache_beam/runners/common.py +++ b/sdks/python/apache_beam/runners/common.py @@ -190,6 +190,7 @@ class DoFnState(object): self.step_name, aggregator) +# TODO(robertwb): Replace core.DoFnContext with this. class DoFnContext(object): def __init__(self, label, element=None, state=None): http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/9d1fc85d/sdks/python/apache_beam/utils/windowed_value.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/utils/windowed_value.py b/sdks/python/apache_beam/utils/windowed_value.py index 5172b36..4c50e72 100644 --- a/sdks/python/apache_beam/utils/windowed_value.py +++ b/sdks/python/apache_beam/utils/windowed_value.py @@ -72,11 +72,16 @@ class WindowedValue(object): # We'd rather implement __eq__, but Cython supports that via __richcmp__ # instead. Fortunately __cmp__ is understood by both (but not by Python 3). def __cmp__(left, right): # pylint: disable=no-self-argument + """Compares left and right for equality. + + For performance reasons, doesn't actually impose an ordering + on unequal values (always returning 1). + """ if type(left) is not type(right): return cmp(type(left), type(right)) else: - # Don't bother paying the cost of a total ordering. # TODO(robertwb): Avoid the type checks? + # Returns False (0) if equal, and True (1) if not. return not WindowedValue._typed_eq(left, right) @staticmethod @@ -111,4 +116,7 @@ def create(value, timestamp_micros, windows): try: WindowedValue.timestamp_object = None except TypeError: - pass # Cythonized class already has this default value. + # When we're compiled, we can't dynamically add attributes to + # the cdef class, but in this case it's OK as it's already present + # on each instance. + pass