Mazen050 commented on code in PR #40501:
URL: https://github.com/apache/beam/pull/40501#discussion_r4426577974


##########
sdks/python/apache_beam/typehints/typecheck.py:
##########
@@ -84,25 +84,67 @@ def teardown(self):
     return self.dofn.teardown()
 
 
-class OutputCheckWrapperDoFn(AbstractDoFnWrapper):
-  """A DoFn that verifies against common errors in the output type."""
-  def __init__(self, dofn, full_label):
+class RuntimeTypeCheckWrapperDoFn(AbstractDoFnWrapper):
+  """A wrapper around a DoFn which performs type-checking of input and 
output."""
+  def __init__(self, dofn, type_hints, full_label):
     super().__init__(dofn)
     self.full_label = full_label
 
+    process_fn = self.dofn._process_argspec_fn()
+    if hasattr(process_fn, '__func__'):

Review Comment:
   Hello, I updated the wrapper to preserve `process_fn.__self__` and pass the 
original bound-method owner to `inspect.getcallargs`, rather than passing the 
DoFn wrapper. I also added a regression test covering a bound method with 
`*args`.



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