From dev-return-13373-apmail-spark-dev-archive=spark.apache.org@spark.apache.org Tue May 26 20:16:27 2015 Return-Path: X-Original-To: apmail-spark-dev-archive@minotaur.apache.org Delivered-To: apmail-spark-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3BC7B18DFB for ; Tue, 26 May 2015 20:16:27 +0000 (UTC) Received: (qmail 86832 invoked by uid 500); 26 May 2015 20:16:25 -0000 Delivered-To: apmail-spark-dev-archive@spark.apache.org Received: (qmail 86746 invoked by uid 500); 26 May 2015 20:16:25 -0000 Mailing-List: contact dev-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@spark.apache.org Received: (qmail 86704 invoked by uid 99); 26 May 2015 20:16:25 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 May 2015 20:16:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 06077C8DF3 for ; Tue, 26 May 2015 20:16:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 6Emz-uRAqqem for ; Tue, 26 May 2015 20:16:13 +0000 (UTC) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 00F16207A7 for ; Tue, 26 May 2015 20:16:12 +0000 (UTC) Received: by lbbuc2 with SMTP id uc2so78711655lbb.2 for ; Tue, 26 May 2015 13:16:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=1vC5PIAecPBXj16AodqqJSurCgaUQdWLvltvwqOruBA=; b=LRSLPeYeXHYediPtGIgWbB0NWGN/DsrHjO5Yk6dACTs/49P3StmSiFusMfCQniqXK+ iDOO8KOh8eeDnAnS2rdv6pyG0Q977Qb3o5jnVthaJetnUtXnB9pyKyJpp6gxoUdwTLPo bFV6BAuI0WrJKIjqier/Wi7NJOfhcXQkLvTx16ChgSRhE0NA/XRLswVmaPf4vJ/rtMKO cnfU6zE1+eGkFJFfjgBGADeN90ItkYZEeMB9BEji6fPBMB6qj99xuEORBvsgN4PejUOQ AewHPex68shTY3PCntX/utDbwev95MO2aVSxGLTOv1iFc+ZxVVMGxx7mwb5J57QY6rQG nhLw== X-Gm-Message-State: ALoCoQnX0ZyPmhbTBnUtX+05oSj7Wq4NLm+kkmvr5HXLUtdeVDBiVWVyfslkRQntrjqr+dMXfWw4 MIME-Version: 1.0 X-Received: by 10.152.3.97 with SMTP id b1mr24822729lab.54.1432671371408; Tue, 26 May 2015 13:16:11 -0700 (PDT) Received: by 10.25.20.208 with HTTP; Tue, 26 May 2015 13:16:11 -0700 (PDT) In-Reply-To: References: Date: Tue, 26 May 2015 13:16:11 -0700 Message-ID: Subject: Re: Spark 1.4.0 pyspark and pylint breaking From: Davies Liu To: Justin Uang Cc: "dev@spark.apache.org" Content-Type: text/plain; charset=UTF-8 When you run the test in python/pyspark/sql/ by bin/spark-submit python/pyspark/sql/dataframe.py the the current directory is the first item in sys.path, sql/types.py will have higher priority then python3.4/types.py, the tests will fail. On Tue, May 26, 2015 at 12:08 PM, Justin Uang wrote: > Thanks for clarifying! I don't understand python package and modules names > that well, but I thought that the package namespacing would've helped, since > you are in pyspark.sql.types. I guess not? > > On Tue, May 26, 2015 at 3:03 PM Davies Liu wrote: >> >> There is a module called 'types' in python 3: >> >> davies@localhost:~/work/spark$ python3 >> Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 00:54:21) >> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import types >> >>> types >> > >> '/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/types.py'> >> >> Without renaming, our `types.py` will conflict with it when you run >> unittests in pyspark/sql/ . >> >> On Tue, May 26, 2015 at 11:57 AM, Justin Uang >> wrote: >> > In commit 04e44b37, the migration to Python 3, pyspark/sql/types.py was >> > renamed to pyspark/sql/_types.py and then some magic in >> > pyspark/sql/__init__.py dynamically renamed the module back to types. I >> > imagine that this is some naming conflict with Python 3, but what was >> > the >> > error that showed up? >> > >> > The reason why I'm asking about this is because it's messing with >> > pylint, >> > since pylint cannot now statically find the module. I tried also >> > importing >> > the package so that __init__ would be run in a init-hook, but that isn't >> > what the discovery mechanism is using. I imagine it's probably just >> > crawling >> > the directory structure. >> > >> > One way to work around this would be something akin to this >> > >> > (http://stackoverflow.com/questions/9602811/how-to-tell-pylint-to-ignore-certain-imports), >> > where I would have to create a fake module, but I would probably be >> > missing >> > a ton of pylint features on users of that module, and it's pretty hacky. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org For additional commands, e-mail: dev-help@spark.apache.org