Skip to content

Conversation

@ksonj
Copy link
Contributor

@ksonj ksonj commented Apr 29, 2015

I believe column access via __getattr__ is bad and shouldn't be implicitly encouraged by the error message when accessing a non-existing attribute on DataFrame. This patch changes the error message from 'no such column' to the more generic 'no such attribute', which is also what Pandas DFs will throw.

@rxin
Copy link
Contributor

rxin commented Apr 29, 2015

Jenkins, test this please.

@SparkQA
Copy link

SparkQA commented Apr 29, 2015

Test build #31263 has finished for PR 5771 at commit bcc2220.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class Hypot(
    • case class Pow(left: Expression, right: Expression) extends BinaryMathExpression(math.pow, "POWER")
    • abstract class MathematicalExpression(f: Double => Double, name: String)
    • case class Acos(child: Expression) extends MathematicalExpression(math.acos, "ACOS")
    • case class Asin(child: Expression) extends MathematicalExpression(math.asin, "ASIN")
    • case class Atan(child: Expression) extends MathematicalExpression(math.atan, "ATAN")
    • case class Cbrt(child: Expression) extends MathematicalExpression(math.cbrt, "CBRT")
    • case class Ceil(child: Expression) extends MathematicalExpression(math.ceil, "CEIL")
    • case class Cos(child: Expression) extends MathematicalExpression(math.cos, "COS")
    • case class Cosh(child: Expression) extends MathematicalExpression(math.cosh, "COSH")
    • case class Exp(child: Expression) extends MathematicalExpression(math.exp, "EXP")
    • case class Expm1(child: Expression) extends MathematicalExpression(math.expm1, "EXPM1")
    • case class Floor(child: Expression) extends MathematicalExpression(math.floor, "FLOOR")
    • case class Log(child: Expression) extends MathematicalExpression(math.log, "LOG")
    • case class Log10(child: Expression) extends MathematicalExpression(math.log10, "LOG10")
    • case class Log1p(child: Expression) extends MathematicalExpression(math.log1p, "LOG1P")
    • case class Rint(child: Expression) extends MathematicalExpression(math.rint, "ROUND")
    • case class Signum(child: Expression) extends MathematicalExpression(math.signum, "SIGNUM")
    • case class Sin(child: Expression) extends MathematicalExpression(math.sin, "SIN")
    • case class Sinh(child: Expression) extends MathematicalExpression(math.sinh, "SINH")
    • case class Tan(child: Expression) extends MathematicalExpression(math.tan, "TAN")
    • case class Tanh(child: Expression) extends MathematicalExpression(math.tanh, "TANH")
  • This patch does not change any dependencies.

@rxin
Copy link
Contributor

rxin commented Apr 29, 2015

Thanks. I'm merging this.

@asfgit asfgit closed this in 3df9c5d Apr 29, 2015
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request May 28, 2015
I believe column access via `__getattr__` is bad and shouldn't be implicitly encouraged by the error message when accessing a non-existing attribute on DataFrame. This patch changes the error message from 'no such column'  to the more generic 'no such attribute', which is also what Pandas DFs will throw.

Author: ksonj <[email protected]>

Closes apache#5771 from ksonj/master and squashes the following commits:

bcc2220 [ksonj] Better error message on access to non-existing attribute
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request Jun 12, 2015
I believe column access via `__getattr__` is bad and shouldn't be implicitly encouraged by the error message when accessing a non-existing attribute on DataFrame. This patch changes the error message from 'no such column'  to the more generic 'no such attribute', which is also what Pandas DFs will throw.

Author: ksonj <[email protected]>

Closes apache#5771 from ksonj/master and squashes the following commits:

bcc2220 [ksonj] Better error message on access to non-existing attribute
nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
I believe column access via `__getattr__` is bad and shouldn't be implicitly encouraged by the error message when accessing a non-existing attribute on DataFrame. This patch changes the error message from 'no such column'  to the more generic 'no such attribute', which is also what Pandas DFs will throw.

Author: ksonj <[email protected]>

Closes apache#5771 from ksonj/master and squashes the following commits:

bcc2220 [ksonj] Better error message on access to non-existing attribute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants