Skip to content

Commit

Permalink
[Feature store] Fix bugs in spark ingest (#915)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaronha committed May 4, 2021
1 parent d5d3b1d commit 0bd0881
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mlrun/feature_store/api.py
Expand Up @@ -232,6 +232,7 @@ def ingest(
targets,
infer_options=infer_options,
mlrun_context=mlrun_context,
namespace=namespace,
)

if isinstance(source, str):
Expand Down Expand Up @@ -420,9 +421,12 @@ def _ingest_with_spark(
# create spark context
from pyspark.sql import SparkSession

spark = SparkSession.builder.appName(
f"{mlrun_context.name}-{mlrun_context.uid}"
).getOrCreate()
if mlrun_context:
session_name = f"{mlrun_context.name}-{mlrun_context.uid}"
else:
session_name = f"{featureset.metadata.project}-{featureset.metadata.name}"

spark = SparkSession.builder.appName(session_name).getOrCreate()

df = source.to_spark_df(spark)
df = run_spark_graph(df, featureset, namespace, spark)
Expand Down

0 comments on commit 0bd0881

Please sign in to comment.