damccorm commented on code in PR #26383:
URL: https://github.com/apache/beam/pull/26383#discussion_r1175757306
##########
sdks/python/apache_beam/runners/dataflow/internal/apiclient.py:
##########
@@ -1207,19 +1207,21 @@ def get_container_image_from_options(pipeline_options):
if worker_options.sdk_container_image:
return worker_options.sdk_container_image
- # TODO(tvalentyn): Use enumerated type instead of strings for job types.
- if _is_runner_v2(pipeline_options):
- fnapi_suffix = '-fnapi'
- else:
- fnapi_suffix = ''
+ is_runner_v2 = _is_runner_v2(pipeline_options)
+ # Legacy and runner v2 exist in different repositories.
+ # Set to legacy format, override if runner v2
version_suffix = '%s%s' % (sys.version_info[0:2])
- image_name = '{repository}/python{version_suffix}{fnapi_suffix}'.format(
- repository=names.DATAFLOW_CONTAINER_IMAGE_REPOSITORY,
- version_suffix=version_suffix,
- fnapi_suffix=fnapi_suffix)
+ container_repo = names.DATAFLOW_CONTAINER_IMAGE_REPOSITORY
+ image_name = '{repository}/python{version_suffix}'.format(
+ repository=container_repo, version_suffix=version_suffix)
+
+ if is_runner_v2:
+ version_suffix = '%s.%s' % (sys.version_info[0:2])
Review Comment:
We actually need this, it inserts a . while the last one does not.
With that said, I don't think this is helpful (the difference is too
subtle), so I removed version_suffix entirely and replaced it with major/minor
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]