This is an automated email from the ASF dual-hosted git repository.

eladkal pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new ce5104d35d1 Fix SparkConnectHook unsupported-path error message 
(#74847)
ce5104d35d1 is described below

commit ce5104d35d1d396a3cedbdc868c8c8777ff45e58
Author: lnc <[email protected]>
AuthorDate: Mon Nov 9 03:32:29 2026 -0800

    Fix SparkConnectHook unsupported-path error message (#74847)
    
    The ValueError raised when a Spark Connect connection host carries a URL
    path was missing the f-string prefix, so users saw the literal text
    "{url.path}" instead of the path they configured.
---
 .../spark/src/airflow/providers/apache/spark/hooks/spark_connect.py     | 2 +-
 .../apache/spark/tests/unit/apache/spark/hooks/test_spark_connect.py    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_connect.py
 
b/providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_connect.py
index 67ff43b5e84..307dcaca91f 100644
--- 
a/providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_connect.py
+++ 
b/providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_connect.py
@@ -73,7 +73,7 @@ class SparkConnectHook(BaseHook, LoggingMixin):
         url = urlparse(host)
 
         if url.path:
-            raise ValueError("Path {url.path} is not supported in Spark 
Connect connection URL")
+            raise ValueError(f"Path {url.path} is not supported in Spark 
Connect connection URL")
 
         params = []
 
diff --git 
a/providers/apache/spark/tests/unit/apache/spark/hooks/test_spark_connect.py 
b/providers/apache/spark/tests/unit/apache/spark/hooks/test_spark_connect.py
index 803a35a5cf4..e2a02f5cff3 100644
--- a/providers/apache/spark/tests/unit/apache/spark/hooks/test_spark_connect.py
+++ b/providers/apache/spark/tests/unit/apache/spark/hooks/test_spark_connect.py
@@ -66,5 +66,5 @@ class TestSparkConnectHook:
         assert hook.get_connection_url() == expected_url
 
         hook = SparkConnectHook(conn_id="spark-app")
-        with pytest.raises(ValueError, match="not supported in Spark Connect 
connection URL"):
+        with pytest.raises(ValueError, match="Path /app is not supported in 
Spark Connect connection URL"):
             hook.get_connection_url()

Reply via email to