jrmccluskey commented on code in PR #25795:
URL: https://github.com/apache/beam/pull/25795#discussion_r1136072403


##########
sdks/python/apache_beam/typehints/opcodes.py:
##########
@@ -440,18 +450,30 @@ def make_function(state, arg):
   """
   # TODO(luke-zhu): Handle default argument types
   globals = state.f.__globals__  # Inherits globals from the current frame
-  func_name = state.stack[-1].value
-  func_code = state.stack[-2].value
-  pop_count = 2
+  tos = state.stack[-1].value
+  if isinstance(tos, types.CodeType):
+    func_name = None

Review Comment:
   This is related to the lack of a fully qualified name being pushed onto the 
stack for lambdas in 3.11 on. For pre-3.11 versions TOS in calls to 
`make_function()` will always be a string containing the fully qualified name 
of the function being made, but post-3.11 this could just be the code for the 
lambda. We have to check for this case and adjust the indices we access on the 
stack accordingly to avoid index-out-of-range issues



-- 
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]

Reply via email to