Return-Path: X-Original-To: apmail-spark-commits-archive@minotaur.apache.org Delivered-To: apmail-spark-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AB5E618E79 for ; Thu, 17 Mar 2016 17:16:57 +0000 (UTC) Received: (qmail 22793 invoked by uid 500); 17 Mar 2016 17:16:57 -0000 Delivered-To: apmail-spark-commits-archive@spark.apache.org Received: (qmail 22764 invoked by uid 500); 17 Mar 2016 17:16:57 -0000 Mailing-List: contact commits-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@spark.apache.org Received: (qmail 22752 invoked by uid 99); 17 Mar 2016 17:16:57 -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, 17 Mar 2016 17:16:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 53627DFA0A; Thu, 17 Mar 2016 17:16:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jkbradley@apache.org To: commits@spark.apache.org Message-Id: <377cc838fccb4947a490e28fe5574482@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: spark git commit: [SPARK-13937][PYSPARK][ML] Change JavaWrapper _java_obj from static to member variable Date: Thu, 17 Mar 2016 17:16:57 +0000 (UTC) Repository: spark Updated Branches: refs/heads/master 3ee799618 -> 828213d4c [SPARK-13937][PYSPARK][ML] Change JavaWrapper _java_obj from static to member variable ## What changes were proposed in this pull request? In PySpark wrapper.py JavaWrapper change _java_obj from an unused static variable to a member variable that is consistent with usage in derived classes. ## How was this patch tested? Ran python tests for ML and MLlib. Author: Bryan Cutler Closes #11767 from BryanCutler/JavaWrapper-static-_java_obj-SPARK-13937. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/828213d4 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/828213d4 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/828213d4 Branch: refs/heads/master Commit: 828213d4ca4b0e845c4d6d778455335f187158a4 Parents: 3ee7996 Author: Bryan Cutler Authored: Thu Mar 17 10:16:51 2016 -0700 Committer: Joseph K. Bradley Committed: Thu Mar 17 10:16:51 2016 -0700 ---------------------------------------------------------------------- python/pyspark/ml/wrapper.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/828213d4/python/pyspark/ml/wrapper.py ---------------------------------------------------------------------- diff --git a/python/pyspark/ml/wrapper.py b/python/pyspark/ml/wrapper.py index 0f7b5e9..37dcb23 100644 --- a/python/pyspark/ml/wrapper.py +++ b/python/pyspark/ml/wrapper.py @@ -34,10 +34,15 @@ class JavaWrapper(Params): __metaclass__ = ABCMeta - #: The wrapped Java companion object. Subclasses should initialize - #: it properly. The param values in the Java object should be - #: synced with the Python wrapper in fit/transform/evaluate/copy. - _java_obj = None + def __init__(self): + """ + Initialize the wrapped java object to None + """ + super(JavaWrapper, self).__init__() + #: The wrapped Java companion object. Subclasses should initialize + #: it properly. The param values in the Java object should be + #: synced with the Python wrapper in fit/transform/evaluate/copy. + self._java_obj = None @staticmethod def _new_java_obj(java_class, *args): --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org For additional commands, e-mail: commits-help@spark.apache.org