tvalentyn commented on code in PR #35904:
URL: https://github.com/apache/beam/pull/35904#discussion_r2377292871


##########
sdks/python/apache_beam/internal/cloudpickle_pickler.py:
##########
@@ -29,16 +29,20 @@
 
 import base64
 import bz2
+import contextlib
 import io
 import logging
 import sys
 import threading
+from unittest import mock

Review Comment:
   would it suffice to:
   
   ```
   def _custom_dynamic_function_reduce():
      ...
   
   if (<setting is enabled>):
      cloudpickle._dynamic_function_reduce = _custom_dynamic_function_reduce
   ```
   
   so that we:
   1) patch a single function
   2) don't pull a test dependency (unittest.mock)



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