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 8F021200C5A for ; Tue, 18 Apr 2017 18:24:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8DAFA160BA1; Tue, 18 Apr 2017 16:24:45 +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 D6488160B90 for ; Tue, 18 Apr 2017 18:24:44 +0200 (CEST) Received: (qmail 68545 invoked by uid 500); 18 Apr 2017 16:24:44 -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 68535 invoked by uid 99); 18 Apr 2017 16:24:44 -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; Tue, 18 Apr 2017 16:24:44 +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 7B4281857B9 for ; Tue, 18 Apr 2017 16:24:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id z9ilR9D6tjKH for ; Tue, 18 Apr 2017 16:24:42 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 7147960DB8 for ; Tue, 18 Apr 2017 16:24:42 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D07F4E04FE for ; Tue, 18 Apr 2017 16:24:41 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 868FE21B44 for ; Tue, 18 Apr 2017 16:24:41 +0000 (UTC) Date: Tue, 18 Apr 2017 16:24:41 +0000 (UTC) From: "Daniel Halperin (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (BEAM-1996) Error about mixing pipelines in nosetests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 18 Apr 2017 16:24:45 -0000 [ https://issues.apache.org/jira/browse/BEAM-1996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15973001#comment-15973001 ] Daniel Halperin commented on BEAM-1996: --------------------------------------- Maybe [~charleschen] has feedback here? > Error about mixing pipelines in nosetests > ----------------------------------------- > > Key: BEAM-1996 > URL: https://issues.apache.org/jira/browse/BEAM-1996 > Project: Beam > Issue Type: Bug > Components: sdk-py > Reporter: Vilhelm von Ehrenheim > Assignee: Charles Chen > Priority: Minor > > When testing a PTranform (defined using @ptransform_fn) that merges several PCollections from different sources the following error is raised: > {noformat}ValueError: Mixing value from different pipelines not allowed.{noformat} > Actually running the same pipeline in GCP using the `DataflowRunner` does not give any error. Neither does running the test file manually instead of through nose. > Here is an example: > {code:none|title=utils.py} > # Defined in module `utils` > @ptransform_fn > def Join(pcolls, by): > return pcolls | beam.CoGroupByKey() > {code} > {code:none|title=test_utils.py} > class UtilsTest(unittest.TestCase): > def test_join(self): > p = TestPipeline(runner="DirectRunner") > p1 = (p > | "Create p1" >> beam.Create([ > {'a': 1, 'b': 11}, > {'a': 2, 'b': 22}, > {'a': 3, 'b': 33}])) > p2 = (p > | "Create p2" >> beam.Create([ > {'a': 1, 'c': 111}, > {'a': 1, 'c': 112}, > {'a': 3, 'c': 333}])) > res = ((p1, p2) | "LeftJoin" >> utils.Join(by='a')) > beam.assert_that(res, beam.equal_to([ > {'a': 1, 'b': 11, 'c': 111}, > {'a': 1, 'b': 11, 'c': 112}, > {'a': 2, 'b': 22}, > {'a': 3, 'b': 33, 'c': 333}])) > # Run test pipeline > p.run() > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)