From 013bfbde8a7568deaae2c6f9de080d00ef82e0e6 Mon Sep 17 00:00:00 2001 From: Arnav Date: Tue, 4 Aug 2026 10:30:27 +0530 Subject: [PATCH] Spark: Fix missing space in YARN waitAppCompletion error message Fix implicit string literal concatenation missing a space between 'conflicts' and 'with' in _YarnSparkSubmitBackend. --- .../airflow/providers/apache/spark/operators/spark_submit.py | 2 +- .../tests/unit/apache/spark/operators/test_spark_submit.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/providers/apache/spark/src/airflow/providers/apache/spark/operators/spark_submit.py b/providers/apache/spark/src/airflow/providers/apache/spark/operators/spark_submit.py index 096f9ca84fc37..d70729cb27f21 100644 --- a/providers/apache/spark/src/airflow/providers/apache/spark/operators/spark_submit.py +++ b/providers/apache/spark/src/airflow/providers/apache/spark/operators/spark_submit.py @@ -152,7 +152,7 @@ class _YarnSparkSubmitBackend(_SparkSubmitDeploymentBackend): def submit_job(self, context: Context) -> str | None: if self.hook._conf.get("spark.yarn.submit.waitAppCompletion", "").strip().lower() == "true": raise ValueError( - "spark.yarn.submit.waitAppCompletion=true cannot be set for cluster mode as it conflicts" + "spark.yarn.submit.waitAppCompletion=true cannot be set for cluster mode as it conflicts " "with the need to exit spark-submit immediately to persist the application ID for tracking. " "Either remove the explicit conf or set durable=False." ) diff --git a/providers/apache/spark/tests/unit/apache/spark/operators/test_spark_submit.py b/providers/apache/spark/tests/unit/apache/spark/operators/test_spark_submit.py index 18a3928e7910c..953af3408d051 100644 --- a/providers/apache/spark/tests/unit/apache/spark/operators/test_spark_submit.py +++ b/providers/apache/spark/tests/unit/apache/spark/operators/test_spark_submit.py @@ -819,7 +819,10 @@ def test_yarn_raises_if_wait_app_completion_true(self): hook._conf = {"spark.yarn.submit.waitAppCompletion": "true"} operator._hook = hook - with pytest.raises(ValueError, match="waitAppCompletion=true"): + with pytest.raises( + ValueError, + match=r"spark\.yarn\.submit\.waitAppCompletion=true cannot be set for cluster mode as it conflicts with the need", + ): operator.submit_job(context={}) def test_yarn_poll_tolerates_transient_resourcemanager_failures(self):