tannnmayy commented on code in PR #40855:
URL: https://github.com/apache/beam/pull/40855#discussion_r4412043592


##########
sdks/python/apache_beam/ml/inference/base_test.py:
##########
@@ -3153,5 +3154,27 @@ def 
test_run_inference_dofn_model_update_acquires_and_releases_matching_tag(
       dofn._model.force_reset()
 
 
+class ResourceImportTest(unittest.TestCase):

Review Comment:
   Thanks for the welcome! Makes sense. I removed the subprocess test and added 
`test_no_resource_warning_when_model_manager_unavailable` to 
`RunInferenceBaseTest`. It patches `ModelManager` to `None`, runs RunInference 
with `FakeModelHandler`, and checks that the "Resource module is not available" 
warning isn't logged. It's skipped on Windows, where `resource` doesn't exist.
   
   Without torch, as in the default test environment, it fails on the old code 
and passes with the fix. With torch installed it passes either way, since the 
original bug happened at import time.
   
   I also merged master and moved the CHANGES.md entry to 2.79.0, since 2.78.0 
has been cut.
   



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