tvalentyn commented on a change in pull request #14390:
URL: https://github.com/apache/beam/pull/14390#discussion_r616242588
##########
File path: sdks/python/apache_beam/runners/pipeline_context.py
##########
@@ -118,13 +120,19 @@ def get_by_id(self, id):
def get_by_proto(self, maybe_new_proto, label=None, deduplicate=False):
# type: (message.Message, Optional[str], bool) -> str
+ obj = self._obj_type.from_runner_api(
Review comment:
I wanted to reference the commmit in this PR that isolates this
particular change. But thanks for adding the reference to the PR that seems to
introduce the bug.
I think the current approach in component id map assumes that we maintain
`id->proto`
and (bidirectional) `id<->obj` relations. Whenever one of `(obj, proto)` is
added to context, the counterpart is obtained through translation. Then
inverse `proto->id` relation is currently not maintained in a map. But it is
computed via `proto->FromRunnerAPI->obj->id` lookup. I suppose we could add a
map to cache this lookup? But I think this does not change the assumption that
both obj, and proto are needed to add a new element to the map.
--
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]