Skip to content

Commit

Permalink
add spark session
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-wang-dl committed May 30, 2024
1 parent 668f062 commit 1e311e8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions joblibspark/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from pyspark import cloudpickle
from pyspark.util import VersionUtils

from .utils import get_spark_session

def register():
"""
Expand Down Expand Up @@ -72,10 +73,7 @@ def __init__(self, **backend_args):
super(SparkDistributedBackend, self).__init__(**backend_args)
self._pool = None
self._n_jobs = None
self._spark = SparkSession \
.builder \
.appName("JoblibSparkBackend") \
.getOrCreate()
self._spark = get_spark_session()
self._spark_context = self._spark.sparkContext
self._job_group = "joblib-spark-job-group-" + str(uuid.uuid4())
self._spark_pinned_threads_enabled = isinstance(
Expand Down

0 comments on commit 1e311e8

Please sign in to comment.