gemini-code-assist[bot] commented on code in PR #38108:
URL: https://github.com/apache/beam/pull/38108#discussion_r3106167995
##########
sdks/python/apache_beam/typehints/schema_registry.py:
##########
@@ -43,6 +43,15 @@ def add(self, typing, schema):
if schema.id:
self.by_id[schema.id] = (typing, schema)
+ def load_registered_typings(self, by_id):
+ for id, typing in by_id.items():
+ if id not in self.by_id:
+ self.by_id[id] = (typing, None)
Review Comment:

The variable name `id` shadows the built-in Python function `id()`.
Additionally, the argument name `by_id` is slightly confusing because it
contains a mapping of IDs to typings, whereas the class attribute `self.by_id`
stores tuples of `(typing, schema)`. Renaming these to `id_to_typing` and
`schema_id` improves clarity and avoids potential conflicts with built-in names.
```suggestion
def load_registered_typings(self, id_to_typing):
for schema_id, typing in id_to_typing.items():
if schema_id not in self.by_id:
self.by_id[schema_id] = (typing, None)
```
--
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]