Skip to content

Commit 62a46c1

Browse files
authored
Added append_job_name parameter to DataflowTemplatedJobStartOperator (#25746)
1 parent 5b9aa48 commit 62a46c1

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

β€Žairflow/providers/google/cloud/operators/dataflow.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ class DataflowTemplatedJobStartOperator(BaseOperator):
499499
<https://cloud.google.com/dataflow/docs/reference/rest/v1b3/RuntimeEnvironment>`__
500500
:param cancel_timeout: How long (in seconds) operator should wait for the pipeline to be
501501
successfully cancelled when task is being killed.
502+
:param append_job_name: True if unique suffix has to be appended to job name.
502503
:param wait_until_finished: (Optional)
503504
If True, wait for the end of pipeline execution before exiting.
504505
If False, only submits job.
@@ -612,6 +613,7 @@ def __init__(
612613
environment: Optional[Dict] = None,
613614
cancel_timeout: Optional[int] = 10 * 60,
614615
wait_until_finished: Optional[bool] = None,
616+
append_job_name: bool = True,
615617
**kwargs,
616618
) -> None:
617619
super().__init__(**kwargs)
@@ -631,6 +633,7 @@ def __init__(
631633
self.environment = environment
632634
self.cancel_timeout = cancel_timeout
633635
self.wait_until_finished = wait_until_finished
636+
self.append_job_name = append_job_name
634637

635638
def execute(self, context: 'Context') -> dict:
636639
self.hook = DataflowHook(
@@ -657,6 +660,7 @@ def set_current_job(current_job):
657660
project_id=self.project_id,
658661
location=self.location,
659662
environment=self.environment,
663+
append_job_name=self.append_job_name,
660664
)
661665

662666
return job

β€Žtests/providers/google/cloud/operators/test_dataflow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ def test_exec(self, dataflow_mock):
482482
project_id=None,
483483
location=TEST_LOCATION,
484484
environment={'maxWorkers': 2},
485+
append_job_name=True,
485486
)
486487

487488

0 commit comments

Comments
 (0)