mik-laj commented on a change in pull request #8531:
URL: https://github.com/apache/airflow/pull/8531#discussion_r416172704
##########
File path: airflow/providers/google/cloud/hooks/dataflow.py
##########
@@ -548,23 +554,17 @@ def start_template_dataflow(
:type location: str
"""
name = self._build_dataflow_job_name(job_name, append_job_name)
- # Builds RuntimeEnvironment from variables dictionary
- #
https://cloud.google.com/dataflow/docs/reference/rest/v1b3/RuntimeEnvironment
- environment = {}
- for key in ['numWorkers', 'maxWorkers', 'zone', 'serviceAccountEmail',
- 'tempLocation', 'bypassTempDirValidation', 'machineType',
- 'additionalExperiments', 'network', 'subnetwork',
'additionalUserLabels']:
- if key in variables:
- environment.update({key: variables[key]})
- body = {"jobName": name,
- "parameters": parameters,
- "environment": environment}
+
service = self.get_conn()
request = service.projects().locations().templates().launch( #
pylint: disable=no-member
projectId=project_id,
location=location,
gcsPath=dataflow_template,
- body=body
+ body={
+ "jobName": name,
+ "parameters": parameters,
+ "environment": variables
Review comment:
This is problematic, but someone once created a parameter and called
`variables`. He used the same name elsewhere. Now I am trying to maintain
backward compatibility. In the next PR I will try to change the names of the
arguments, but this will require more work to maintain backward compatibility.
Formerly `variables` parameters contain environments + project id + region.
It was similar to the native pipeline, where the region was also passed as an
argument. `python pipeline.py --region=europe-west-1`. However, this was
changed when I introduced the changes required by the [GCP
guidelines](https://docs.google.com/document/d/1_rTdJSLCt0eyrAylmmgYc3yZr-_h51fVlnvMmWqhCkY/edit).
Now it contains only environment parameters
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]