This is an automated email from the ASF dual-hosted git repository.
shahar1 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 dca1d97eaf4 Drop unused post_submit_commands copy from
SparkSubmitOperator init (#70323)
dca1d97eaf4 is described below
commit dca1d97eaf47ab90dda546a46a167b05184365bc
Author: Stefan Wang <[email protected]>
AuthorDate: Fri Jul 24 00:39:21 2026 -0700
Drop unused post_submit_commands copy from SparkSubmitOperator init (#70323)
post_submit_commands is a template field, so it is rendered after __init__
runs. The constructor kept a second, private list copy
(self._post_submit_commands) built from the un-rendered value, but nothing
reads it: the operator forwards the rendered self.post_submit_commands to
SparkSubmitHook, which builds its own list. Removing the dead copy stops the
constructor reading the template field and lets its validate-operators-init
exemption go.
related: #70296
Signed-off-by: 1fanwang <[email protected]>
---
.../spark/src/airflow/providers/apache/spark/operators/spark_submit.py | 1 -
scripts/ci/prek/validate_operators_init_exemptions.txt | 1 -
2 files changed, 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 8a2129e9673..290ec50cd91 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
@@ -263,7 +263,6 @@ class SparkSubmitOperator(ResumableJobMixin, BaseOperator):
self._deploy_mode = deploy_mode
self._hook: SparkSubmitHook | None = None
self.post_submit_commands = post_submit_commands
- self._post_submit_commands = list(post_submit_commands) if
post_submit_commands else []
self._conn_id = conn_id
self._use_krb5ccache = use_krb5ccache
self._yarn_track_via_rm_api = yarn_track_via_rm_api
diff --git a/scripts/ci/prek/validate_operators_init_exemptions.txt
b/scripts/ci/prek/validate_operators_init_exemptions.txt
index 7ff6497cf73..0f5c1e5e263 100644
--- a/scripts/ci/prek/validate_operators_init_exemptions.txt
+++ b/scripts/ci/prek/validate_operators_init_exemptions.txt
@@ -26,7 +26,6 @@
providers/anthropic/src/airflow/providers/anthropic/operators/agent.py::Anthropi
providers/apache/hive/src/airflow/providers/apache/hive/sensors/hive_partition.py::HivePartitionSensor
providers/apache/hive/src/airflow/providers/apache/hive/sensors/named_hive_partition.py::NamedHivePartitionSensor
providers/apache/kafka/src/airflow/providers/apache/kafka/operators/produce.py::ProduceToTopicOperator
-providers/apache/spark/src/airflow/providers/apache/spark/operators/spark_submit.py::SparkSubmitOperator
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/kueue.py::KubernetesInstallKueueOperator
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py::KubernetesPodOperator
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/resource.py::KubernetesResourceBaseOperator