Skip to content

Commit

Permalink
spark library: correct use of appname
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieucan committed Dec 5, 2017
1 parent 5254e83 commit 30042d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lb/blocks/spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# Initialised on demand to avoid losing time when this file is imported but not used.
SC = None

def get_spark_context(master):
def get_spark_context(master, appname='lambdablocks'):
"""Creates a Spark context. Useful to have it in a function,
otherwise within a module it will be created at import time, even
if not used.
Expand All @@ -33,7 +33,7 @@ def get_spark_context(master):
"""
global SC
if SC is None:
SC = pyspark.SparkContext(master, 'lambdablocks')
SC = pyspark.SparkContext(master, appname)
return SC

### Standard Spark programming library
Expand All @@ -50,7 +50,7 @@ def spark_readfile(master: str='local[4]', appname: str='lambdablocks', filename
:output RDD result: The resulting RDD.
"""
def inner() -> ReturnType[pyspark.rdd.RDD]:
spark_context = get_spark_context(master)
spark_context = get_spark_context(master, appname)
o = spark_context.textFile(filename)
return ReturnEntry(result=o)
return inner
Expand Down

0 comments on commit 30042d5

Please sign in to comment.