Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,14 @@ def _resolve_connection(self) -> dict[str, Any]:
if not self.spark_binary:
self.spark_binary = extra.get("spark-binary", DEFAULT_SPARK_BINARY)
if self.spark_binary is not None and self.spark_binary not in ALLOWED_SPARK_BINARIES:
raise RuntimeError(
f"The spark-binary extra can be on of {ALLOWED_SPARK_BINARIES} and it"
raise ValueError(
f"The spark-binary extra can be one of {ALLOWED_SPARK_BINARIES} and it"
f" was `{self.spark_binary}`. Please make sure your spark binary is one of the"
f" allowed ones and that it is available on the PATH"
)
conn_spark_home = extra.get("spark-home")
if conn_spark_home:
raise RuntimeError(
raise ValueError(
"The `spark-home` extra is not allowed any more. Please make sure one of"
f" {ALLOWED_SPARK_BINARIES} is available on the PATH, and set `spark-binary`"
" if needed."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,11 @@ def test_resolve_connection_custom_spark_binary_allowed_in_hook(self):
SparkSubmitHook(conn_id="spark_binary_set", spark_binary="another-custom-spark-submit")

def test_resolve_connection_spark_binary_extra_not_allowed_runtime_error(self):
with pytest.raises(RuntimeError):
with pytest.raises(ValueError):
SparkSubmitHook(conn_id="spark_custom_binary_set")

def test_resolve_connection_spark_home_not_allowed_runtime_error(self):
with pytest.raises(RuntimeError):
with pytest.raises(ValueError):
SparkSubmitHook(conn_id="spark_home_set")

def test_resolve_connection_spark_binary_default_value_override(self):
Expand Down
Loading