kristynsmith commented on code in PR #35656:
URL: https://github.com/apache/beam/pull/35656#discussion_r2260667875


##########
sdks/python/apache_beam/internal/code_object_pickler.py:
##########
@@ -95,13 +105,16 @@ def _extend_path(prefix, suffix):
   return prefix + '.' + suffix
 
 
-def _search(callable, node, qual_name_parts):
+def _search(
+    callable: types.FunctionType, node: object, qual_name_parts: list[str]):
   """Searches an object to create a stable reference code path.
 
   Recursively searches the tree of objects starting from node and looking for
   callable and returns a string to uniquely identify the path from node to the
   callable.
 
+  Example of qual_name_parts: ['MyClass', 'process', '<locals>', '<lambda>']

Review Comment:
   I updated the docstring with some more context. 
   
   > For example which qual_name_parts need to be specified when? can it be an 
empty list?
   
   i don't think this is relevant for the use of qual_name_parts. it is passed 
directly from get_code_path where we do `callable.__qualname__.split('.')`. if 
the object passed doesn't have the __qualname__ attribute, then it returns 
None. __qualname__ is never an empty string, thus qual_name_parts can never be 
an empty list
   



-- 
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: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to