Skip to content

Commit b706da0

Browse files
authored
Fix local submission issues. (feathr-ai#988)
* Fix local submission issues * Update _localspark_submission.py * Update client.py * Update _localspark_submission.py * Update _localspark_submission.py
1 parent 4493867 commit b706da0

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

feathr_project/feathr/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,9 @@ def _construct_redis_key(self, feature_table, key):
469469
def _str_to_bool(self, s: str, variable_name = None):
470470
"""Define a function to detect convert string to bool, since Redis client sometimes require a bool and sometimes require a str
471471
"""
472-
if s.casefold() == 'True'.casefold() or s == True:
472+
if (isinstance(s, str) and s.casefold() == 'True'.casefold()) or s == True:
473473
return True
474-
elif s.casefold() == 'False'.casefold() or s == False:
474+
elif (isinstance(s, str) and s.casefold() == 'False'.casefold()) or s == False:
475475
return False
476476
else:
477477
self.logger.warning(f'{s} is not a valid Bool value. Maybe you want to double check if it is set correctly for {variable_name}.')

feathr_project/feathr/spark_provider/_localspark_submission.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ def submit_feathr_job(
8484
cfg = configuration.copy() if configuration else {}
8585
maven_dependency = f"{cfg.pop('spark.jars.packages', self.packages)},{get_maven_artifact_fullname()}"
8686
spark_args = self._init_args(job_name=job_name, confs=cfg)
87-
87+
# Add additional repositories
88+
spark_args.extend(["--repositories", "https://repository.mulesoft.org/nexus/content/repositories/public/,https://linkedin.jfrog.io/artifactory/open-source/"])
89+
# spark_args.extend(["--repositories", "https://linkedin.jfrog.io/artifactory/open-source/"])
90+
8891
if not main_jar_path:
8992
# We don't have the main jar, use Maven
9093
if not python_files:
@@ -106,7 +109,16 @@ def submit_feathr_job(
106109
print(python_files)
107110
spark_args.append(python_files[0])
108111
else:
109-
spark_args.extend(["--class", main_class_name, main_jar_path])
112+
if not python_files:
113+
# This is a JAR job
114+
spark_args.extend(["--class", main_class_name, main_jar_path])
115+
else:
116+
spark_args.extend(["--packages", maven_dependency])
117+
# This is a PySpark job, no more things to
118+
if python_files.__len__() > 1:
119+
spark_args.extend(["--py-files", ",".join(python_files[1:])])
120+
spark_args.append(python_files[0])
121+
110122

111123
if arguments:
112124
spark_args.extend(arguments)
@@ -299,4 +311,5 @@ def _get_default_package(self):
299311
packages.append("commons-io:commons-io:2.6")
300312
packages.append("org.apache.hadoop:hadoop-azure:2.7.4")
301313
packages.append("com.microsoft.azure:azure-storage:8.6.4")
314+
packages.append("com.github.everit-org.json-schema:org.everit.json.schema:1.9.1")
302315
return ",".join(packages)

0 commit comments

Comments
 (0)