File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ def __get_dataflow_pipeline_options(
89
89
pipeline_options = copy .deepcopy (pipeline_options )
90
90
if job_name_key is not None :
91
91
pipeline_options [job_name_key ] = job_name
92
+ if self .dataflow_config .service_account :
93
+ pipeline_options ["serviceAccount" ] = self .dataflow_config .service_account
92
94
pipeline_options ["project" ] = self .dataflow_config .project_id
93
95
pipeline_options ["region" ] = self .dataflow_config .location
94
96
pipeline_options .setdefault ("labels" , {}).update (
@@ -182,6 +184,7 @@ def _init_pipeline_options(
182
184
pipeline_options = pipeline_options ,
183
185
job_name_variable_key = job_name_variable_key ,
184
186
)
187
+ self .log .info (pipeline_options )
185
188
186
189
pipeline_options .update (self .pipeline_options )
187
190
Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ class DataflowConfiguration:
124
124
WaitForRun = wait until job finished and the run job.
125
125
Supported only by:
126
126
:py:class:`~airflow.providers.apache.beam.operators.beam.BeamRunJavaPipelineOperator`
127
+ :param service_account: Run the job as a specific service account, instead of the default GCE robot.
127
128
"""
128
129
129
130
template_fields : Sequence [str ] = ("job_name" , "location" )
@@ -144,6 +145,7 @@ def __init__(
144
145
wait_until_finished : Optional [bool ] = None ,
145
146
multiple_jobs : Optional [bool ] = None ,
146
147
check_if_running : CheckJobRunning = CheckJobRunning .WaitForRun ,
148
+ service_account : Optional [str ] = None ,
147
149
) -> None :
148
150
self .job_name = job_name
149
151
self .append_job_name = append_job_name
@@ -158,6 +160,7 @@ def __init__(
158
160
self .wait_until_finished = wait_until_finished
159
161
self .multiple_jobs = multiple_jobs
160
162
self .check_if_running = check_if_running
163
+ self .service_account = service_account
161
164
162
165
163
166
class DataflowCreateJavaJobOperator (BaseOperator ):
You can’t perform that action at this time.
0 commit comments