Return-Path: X-Original-To: apmail-spark-issues-archive@minotaur.apache.org Delivered-To: apmail-spark-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 66B8117E26 for ; Tue, 12 May 2015 03:52:00 +0000 (UTC) Received: (qmail 77139 invoked by uid 500); 12 May 2015 03:52:00 -0000 Delivered-To: apmail-spark-issues-archive@spark.apache.org Received: (qmail 77104 invoked by uid 500); 12 May 2015 03:52:00 -0000 Mailing-List: contact issues-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@spark.apache.org Received: (qmail 77090 invoked by uid 99); 12 May 2015 03:52:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 May 2015 03:52:00 +0000 Date: Tue, 12 May 2015 03:52:00 +0000 (UTC) From: "Reynold Xin (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (SPARK-7035) Drop __getattr__ on pyspark.sql.DataFrame MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SPARK-7035?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Reynold Xin closed SPARK-7035. ------------------------------ Resolution: Won't Fix I'm closing this one for now. We can continue the discussion. > Drop __getattr__ on pyspark.sql.DataFrame > ----------------------------------------- > > Key: SPARK-7035 > URL: https://issues.apache.org/jira/browse/SPARK-7035 > Project: Spark > Issue Type: Sub-task > Components: PySpark > Affects Versions: 1.4.0 > Reporter: Kalle Jepsen > > I think the {{\_\_getattr\_\_}} method on the DataFrame should be removed. > There is no point in having the possibility to address the DataFrames columns as {{df.column}}, other than the questionable goal to please R developers. And it seems R people can use Spark from their native API in the future. > I see the following problems with {{\_\_getattr\_\_}} for column selection: > * It's un-pythonic: There should only be one obvious way to solve a problem, and we can already address columns on a DataFrame via the {{\_\_getitem\_\_}} method, which in my opinion is by far superior and a lot more intuitive. > * It leads to confusing Exceptions. When we mistype a method-name the {{AttributeError}} will say 'No such column ... '. > * And most importantly: we cannot load DataFrames that have columns with the same name as any attribute on the DataFrame-object. Imagine having a DataFrame with a column named {{cache}} or {{filter}}. Calling {{df.cache()}} will be ambiguous and lead to broken code. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org