Skip to content

Commit

Permalink
[AIRFLOW-2692] Add job_name as templated parameter in AWS Batch Operator
Browse files Browse the repository at this point in the history
Closes #3557 from craigforster/master
  • Loading branch information
craigforster authored and Fokko Driesprong committed Jun 29, 2018
1 parent 284dbdb commit 7141abd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions airflow/contrib/operators/awsbatch_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AWSBatchOperator(BaseOperator):
.. warning: the queue parameter was renamed to job_queue to segreggate the
internal CeleryExecutor queue from the AWS Batch internal queue.
:param job_name: the name for the job that will run on AWS Batch
:param job_name: the name for the job that will run on AWS Batch (templated)
:type job_name: str
:param job_definition: the job definition name on AWS Batch
:type job_definition: str
Expand All @@ -59,7 +59,7 @@ class AWSBatchOperator(BaseOperator):
ui_color = '#c3dae0'
client = None
arn = None
template_fields = ('overrides',)
template_fields = ('job_name', 'overrides',)

@apply_defaults
def __init__(self, job_name, job_definition, job_queue, overrides, max_retries=4200,
Expand Down
4 changes: 2 additions & 2 deletions tests/contrib/operators/test_awsbatch_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_init(self):
self.aws_hook_mock.assert_called_once_with(aws_conn_id=None)

def test_template_fields_overrides(self):
self.assertEqual(self.batch.template_fields, ('overrides',))
self.assertEqual(self.batch.template_fields, ('job_name', 'overrides',))

@mock.patch.object(AWSBatchOperator, '_wait_for_task_ended')
@mock.patch.object(AWSBatchOperator, '_check_success_task')
Expand Down Expand Up @@ -176,7 +176,7 @@ def test_check_success_tasks_raises_pending(self):
# Ordering of str(dict) is not guaranteed.
self.assertIn('This task is still pending ', str(e.exception))

def test_check_success_tasks_raises_mutliple(self):
def test_check_success_tasks_raises_multiple(self):
client_mock = mock.Mock()
self.batch.jobId = '8ba9d676-4108-4474-9dca-8bbac1da9b19'
self.batch.client = client_mock
Expand Down

0 comments on commit 7141abd

Please sign in to comment.