aIbrahiim commented on code in PR #37490:
URL: https://github.com/apache/beam/pull/37490#discussion_r2759698993
##########
sdks/python/apache_beam/runners/portability/sdk_container_builder.py:
##########
@@ -325,16 +326,8 @@ def _upload_to_gcs(self, local_file_path, gcs_location):
_LOGGER.info('Completed GCS upload to %s.', gcs_location)
def _get_cloud_build_id_and_log_url(self, metadata):
- id = None
- log_url = None
- for item in metadata.additionalProperties:
- if item.key == 'build':
- for field in item.value.object_value.properties:
- if field.key == 'logUrl':
- log_url = field.value.string_value
- if field.key == 'id':
- id = field.value.string_value
- return id, log_url
+ build = metadata.build
+ return (build.id, build.log_url)
Review Comment:
would it make sense to check if metadata.build is set and fall back to the
previous additionalProperties logic when it’s not so it works with both old and
new library versions?
--
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]