You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by el...@apache.org on 2022/09/30 17:35:20 UTC
[airflow] branch main updated: Add BatchOperator template fields (#26805)
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 677df10254 Add BatchOperator template fields (#26805)
677df10254 is described below
commit 677df102542ab85aab4efbbceb6318a3c7965e2b
Author: D. Ferruzzi <fe...@amazon.com>
AuthorDate: Fri Sep 30 10:35:10 2022 -0700
Add BatchOperator template fields (#26805)
---
airflow/providers/amazon/aws/operators/batch.py | 15 ++++++++++-----
tests/providers/amazon/aws/operators/test_batch.py | 7 ++++++-
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/airflow/providers/amazon/aws/operators/batch.py b/airflow/providers/amazon/aws/operators/batch.py
index 4b15e5e705..7e6576635a 100644
--- a/airflow/providers/amazon/aws/operators/batch.py
+++ b/airflow/providers/amazon/aws/operators/batch.py
@@ -102,11 +102,16 @@ class BatchOperator(BaseOperator):
ui_color = "#c3dae0"
arn = None # type: Optional[str]
template_fields: Sequence[str] = (
- "job_name",
- "job_queue",
- "job_definition",
- "overrides",
- "parameters",
+ 'job_id',
+ 'job_name',
+ 'job_definition',
+ 'job_queue',
+ 'overrides',
+ 'array_properties',
+ 'parameters',
+ 'waiters',
+ 'tags',
+ 'wait_for_completion',
)
template_fields_renderers = {"overrides": "json", "parameters": "json"}
diff --git a/tests/providers/amazon/aws/operators/test_batch.py b/tests/providers/amazon/aws/operators/test_batch.py
index 80addb4ba1..f7613f0fc4 100644
--- a/tests/providers/amazon/aws/operators/test_batch.py
+++ b/tests/providers/amazon/aws/operators/test_batch.py
@@ -101,11 +101,16 @@ class TestBatchOperator(unittest.TestCase):
def test_template_fields_overrides(self):
assert self.batch.template_fields == (
+ "job_id",
"job_name",
- "job_queue",
"job_definition",
+ "job_queue",
"overrides",
+ "array_properties",
"parameters",
+ "waiters",
+ "tags",
+ "wait_for_completion",
)
@mock.patch.object(BatchClientHook, "get_job_description")