damccorm commented on code in PR #38936:
URL: https://github.com/apache/beam/pull/38936#discussion_r3429370167


##########
sdks/python/apache_beam/ml/inference/base.py:
##########
@@ -1997,6 +2013,9 @@ def load():
     # Ensure the tag we're loading is valid, if not replace it with a valid tag
     self._cur_tag = self._model_metadata.get_valid_tag(model_tag)
     if self.use_model_manager:
+      # Force an import here to avoid missing ModelManager when needed.
+      # Throw an error if ModelManager is not available since it's required 
for this code path.
+      ModelManager = _try_import_model_manager(throw_error=True)

Review Comment:
   Rather than this approach, can we:
   
   1) Keep the previous approach
   2) Change this to:
   
   ```
   if ModelManager is None:
      from apache_beam.ml.inference.model_manager import ModelManager
   ```
   
   I think it should be simpler/more consistent with what we do elsewhere



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