Skip to content

Commit

Permalink
fixed python unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekbecker committed Jun 30, 2015
1 parent 45f2bee commit 4d07318
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions python/pyspark/sql/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,10 @@ def e():
Returns the float value that is closer than any other to e, the base of the natural
logarithms.
>>> sqlContext.createDataFrame([(1,)], ['a']).select((e()).alias('e')).collect()
[Row(e=2.7182818284590451)]
>>> e = sqlContext.createDataFrame([(1,)], ['a']).select((e()).alias('e')).collect()
>>> round(e[0][0], 10)
2.7182818285
"""
sc = SparkContext._active_spark_context
jc = sc._jvm.functions.e()
Expand Down Expand Up @@ -377,8 +379,10 @@ def pi():
Returns the float value that is closer than any other to pi, the ratio of the circumference
of a circle to its diameter.
>>> sqlContext.createDataFrame([(1,)], ['a']).select((pi()).alias('pi')).collect()
[Row(pi=3.1415926535897931)]
>>> pi = sqlContext.createDataFrame([(1,)], ['a']).select((pi()).alias('pi')).collect()
>>> round(pi[0][0], 10)
3.1415926536
"""
sc = SparkContext._active_spark_context
jc = sc._jvm.functions.pi()
Expand Down

0 comments on commit 4d07318

Please sign in to comment.