Skip to content

Commit b8f87b6

Browse files
authored
Merge branch 'master' into fix-docker-pull
2 parents cee900a + 9033663 commit b8f87b6

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/sagemaker/spark/processing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ def run(
737737
user code file (default: None).
738738
"""
739739
self._current_job_name = self._generate_current_job_name(job_name=job_name)
740+
self.command = [_SparkProcessorBase._default_command]
740741

741742
if not submit_app:
742743
raise ValueError("submit_app is required")
@@ -917,6 +918,7 @@ def run(
917918
user code file (default: None).
918919
"""
919920
self._current_job_name = self._generate_current_job_name(job_name=job_name)
921+
self.command = [_SparkProcessorBase._default_command]
920922

921923
if not submit_app:
922924
raise ValueError("submit_app is required")

tests/unit/sagemaker/spark/test_processing.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,34 @@ def test_py_spark_processor_run(
738738
)
739739

740740

741+
@patch("sagemaker.spark.processing._SparkProcessorBase.run")
742+
@patch("sagemaker.spark.processing._SparkProcessorBase._stage_submit_deps")
743+
@patch("sagemaker.spark.processing._SparkProcessorBase._generate_current_job_name")
744+
def test_py_spark_processor_run_twice(
745+
mock_generate_current_job_name, mock_stage_submit_deps, mock_super_run, py_spark_processor
746+
):
747+
mock_stage_submit_deps.return_value = (processing_input, "opt")
748+
mock_generate_current_job_name.return_value = "jobName"
749+
expected_command = ["smspark-submit", "--py-files", "opt", "--jars", "opt", "--files", "opt"]
750+
py_spark_processor.run(
751+
submit_app="submit_app",
752+
submit_py_files="files",
753+
submit_jars="test",
754+
submit_files="test",
755+
inputs=[],
756+
)
757+
758+
py_spark_processor.run(
759+
submit_app="submit_app",
760+
submit_py_files="files",
761+
submit_jars="test",
762+
submit_files="test",
763+
inputs=[],
764+
)
765+
766+
assert py_spark_processor.command == expected_command
767+
768+
741769
@pytest.mark.parametrize(
742770
"config, expected",
743771
[

0 commit comments

Comments
 (0)